Point-to-Multipoint Data Transmission Method and Device

ABSTRACT

A point-to-multipoint data transmission method and device, the method including a left earbud and a right earbud of a true wireless stereo (TWS) headset separately performing pairing and service content negotiation with an electronic device. The left earbud receives left configuration information sent by the electronic device, to configure a left ISO channel, and the right earbud receives right configuration information sent by the electronic device, to configure a right ISO channel. The left earbud receives, based on the BLE-based audio profile, audio data that is sent by the electronic device through the left ISO channel, and the right earbud receives, based on the BLE-based audio profile, the audio data that is sent by the electronic device through the right ISO channel. The left earbud and the right earbud play the respectively received audio data based on a first timestamp.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a National Stage of International Application No.PCT/CN2018/118730, filed Nov. 30, 2018, which is hereby incorporated byreference in its entirety.

TECHNICAL FIELD

This application relates to the field of short-range communications, andin particular, to a point-to-multipoint data transmission method anddevice.

BACKGROUND

Bluetooth (Bluetooth) is a wireless technology standard, which canimplement short-distance data exchange between different devices. Forexample, a Bluetooth module on a mobile phone may be enabled forshort-distance data exchange with a Bluetooth headset, to use theBluetooth headset as an audio input/output device of the mobile phone toimplement a call.

Today, Bluetooth is managed by the Bluetooth special interest group(Bluetooth special interest group, SIG), which is mainly responsible forformulating a Bluetooth technical specification. For example, theBluetooth technical specification includes some audio profiles(profile), and the audio profiles are mainly used for point-to-pointdata transmission based on a basic rate (basic rate, BR)/an enhanceddata rate (enhanced data rate, EDR).

With the advancement of science and technology, a true wireless stereo(true wireless stereo, TWS) headset gradually comes into people's sight.The TWS headset includes two headset bodies, for example, respectivelyreferred to as a left earbud and a right earbud, and no cable connectionis required between the left earbud and the right earbud. To use the TWSheadset as an audio input/output device of a mobile phone, data needs tobe transmitted between the mobile phone and the left and right earbudsof the TWS headset separately, and synchronization of audio data isrequired between the left and right earbuds of the TWS headset. It isclearly that the current formulated audio profiles cannot meet therequirements.

SUMMARY

Embodiments of this application provide a point-to-multipoint datatransmission method and device. With Bluetooth, data is transmittedbetween a mobile phone and left and right earbuds of a TWS headsetseparately, and rendering synchronization of audio data between the leftand right earbuds of the TWS headset is implemented.

The following technical solutions are used in this application.

According to a first aspect, this application provides apoint-to-multipoint data transmission method. The method may be appliedto a TWS headset, the TWS headset may include a first earbud and asecond earbud, and the method may include: separately pairing up, by thefirst earbud and the second earbud, with an electronic device;separately performing, by the first earbud and the second earbud,service content negotiation with the electronic device, to obtain aservice type supported by the electronic device, where the service typesupported by the electronic device includes a BLE-based audio profile,and service types supported by the first earbud and the second earbudinclude the BLE-based audio profile; receiving, by the first earbud,first configuration information sent by the electronic device, where thefirst configuration information is used to configure a first ISO channelbetween the first earbud and the electronic device, and receiving, bythe second earbud, second configuration information sent by theelectronic device, where the second configuration information is used toconfigure a second ISO channel between the second earbud and theelectronic device; receiving, by the first earbud based on the BLE-basedaudio profile, audio data that is sent by the electronic device throughthe first ISO channel, and receiving, by the second earbud based on theBLE-based audio profile, the audio data that is sent by the electronicdevice through the second ISO channel; and playing, by the first earbudand the second earbud, the respectively received audio data based on afirst timestamp. The first earbud and the second earbud may be a leftearbud and a right earbud respectively.

By using the technical solution, the audio data is transmitted betweenthe electronic device and the left and right earbuds of the TWS headsetbased on the BLE-based audio profile, thereby implementingpoint-to-multipoint data transmission. In addition, the electronicdevice respectively transmits the audio data to the left and rightearbuds of the TWS headset through the ISO channels, therebyimplementing rendering synchronization of point-to-multipoint audiodata, that is, rendering synchronization in user perception of the audiodata respectively transmitted by the electronic device to the left andright earbuds of the TWS headset.

In a possible implementation, the method may further include: settingup, by the first earbud, a first ACL link to the electronic device; andthe receiving, by the first earbud, first configuration information sentby the electronic device may include: receiving, by the first earbud,the first configuration information that is sent by the electronicdevice over the first ACL link. The method may further include: settingup, by the second earbud, a second ACL link to the electronic device;and the receiving, by the second earbud, second configurationinformation sent by the electronic device may include: receiving, by thesecond earbud, the second configuration information that is sent by theelectronic device over the second ACL link.

In another possible implementation, the method may further include:receiving, by the first earbud based on the BLE-based audio profile,control data that is sent by the electronic device over the first ACLlink, and receiving, by the second earbud based on the BLE-based audioprofile, the control data that is sent by the electronic device over thesecond ACL link; and responding, by the first earbud and the secondearbud, to the respectively received control data based on a second timestamp. In this way, with the audio profile supporting BLE,synchronization of point-to-multipoint control data, that is,synchronization in user perception of the control data respectivelytransmitted by the electronic device to the left and right earbuds ofthe TWS headset, can also be implemented. For example, when the TWSheadset is used as an audio output device of a mobile phone to playmusic, for a user, the mobile phone can ensure that the left and rightearbuds of the TWS headset synchronously play and pause.

In another possible implementation, the receiving, by the first earbudbased on the BLE-based audio profile, audio data that is sent by theelectronic device through the first ISO channel may include: receiving,by the first earbud based on the BLE-based audio profile, a first packetthat is sent by the electronic device through the first ISO channel,where the first packet may include a first payload payload, and thefirst payload includes the audio data and the first timestamp; and thereceiving, by the second earbud based on the BLE-based audio profile,the audio data that is sent by the electronic device through the secondISO channel may include: receiving, by the second earbud based on theBLE-based audio profile, the first packet that is sent by the electronicdevice through the second ISO channel. In this way, the left and rightearbuds of the TWS headset can implement rendering synchronization ofthe audio data based on the first timestamp.

In another possible implementation, the receiving, by the first earbudbased on the BLE-based audio profile, control data that is sent by theelectronic device over the first ACL link may include: receiving, by thefirst earbud based on the BLE-based audio profile, a second packet thatis sent by the electronic device over the first ACL link, where thesecond packet includes a second payload, and the second payload includesthe control data and the second time stamp; and the receiving, by thesecond earbud based on the BLE-based audio profile, the control datathat is sent by the electronic device over the second ACL link mayinclude: receiving, by the second earbud based on the BLE-based audioprofile, the second packet that is sent by the electronic device overthe second ACL link. In this way, the left and right earbuds of the TWSheadset can implement synchronization of the control data based on thesecond timestamp.

According to a second aspect, this application provides apoint-to-multipoint data transmission method. The method may be appliedto an electronic device, and the method may include: separately pairingup, by the electronic device, with a first earbud and a second earbud ofa TWS headset; separately performing, by the electronic device, servicecontent negotiation with the first earbud and the second earbud, toobtain service types supported by the first earbud and the secondearbud, where the service types supported by the first earbud and thesecond earbud include a BLE-based audio profile, and a service typesupported by the electronic device includes the BLE-based audio profile;sending, by the electronic device, first configuration information tothe first earbud, where the first configuration information is used toconfigure a first ISO channel between the electronic device and thefirst earbud, and sending, by the electronic device, secondconfiguration information to the second earbud, where the secondconfiguration information is used to configure a second ISO channelbetween the electronic device and the second earbud; and sending, by theelectronic device based on the BLE-based audio profile, audio data tothe first earbud through the first ISO channel, and sending the audiodata to the second earbud through the second ISO channel.

By using the technical solution, the audio data is transmitted betweenthe electronic device and the left and right earbuds of the TWS headsetbased on the BLE-based audio profile, thereby implementingpoint-to-multipoint data transmission. In addition, the electronicdevice respectively transmits the audio data to the left and rightearbuds of the TWS headset through the ISO channels, therebyimplementing rendering synchronization of point-to-multipoint audiodata, that is, rendering synchronization in user perception of the audiodata respectively transmitted by the electronic device to the left andright earbuds of the TWS headset.

In a possible implementation, the method may further include: settingup, by the electronic device, a first ACL link to the first earbud; andthe sending, by the electronic device, first configuration informationto the first earbud may include: sending, by the electronic device, thefirst configuration information to the first earbud over the first ACLlink. The method may further include: setting up, by the electronicdevice, a second ACL link to the second earbud; and the sending, by theelectronic device, second configuration information to the second earbudmay include: sending, by the electronic device, the second configurationinformation to the second earbud over the second ACL link.

In another possible implementation, the method may further include:sending, by the electronic device based on the BLE-based audio profile,control data to the first earbud over the first ACL link, and sendingthe control data to the second earbud over the second ACL link. In thisway, with the audio profile supporting BLE, synchronization ofpoint-to-multipoint control data, that is, synchronization in userperception of the control data respectively transmitted by theelectronic device to the left and right earbuds of the TWS headset, canalso be implemented.

In another possible implementation, the sending, by the electronicdevice based on the BLE-based audio profile, audio data to the firstearbud through the first ISO channel, and sending the audio data to thesecond earbud through the second ISO channel may include: encoding, bythe electronic device, the audio data based on the BLE-based audioprofile to generate a first packet, where the first packet includes afirst payload payload, the first payload includes the audio data and afirst timestamp, and the first timestamp is used for the first earbudand the second earbud to implement rendering synchronization of theaudio data; sending, by the electronic device, the first packet to thefirst earbud through the first ISO channel; and sending, by theelectronic device, the first packet to the second earbud through thesecond ISO channel. In this way, the left and right earbuds of the TWSheadset can implement rendering synchronization of the audio data basedon the first timestamp.

In another possible implementation, the sending, by the electronicdevice based on the BLE-based audio profile, control data to the firstearbud over the first ACL link, and sending the control data to thesecond earbud over the second ACL link may include: encoding, by theelectronic device, the control data based on the BLE-based audio profileto generate a second packet, where the second packet includes a secondpayload, the second payload includes the control data and a second timestamp, and the second time stamp is used for the first earbud and thesecond earbud to implement synchronization of the control data; sending,by the electronic device, the second packet to the first earbud over thefirst ACL link; and sending, by the electronic device, the second packetto the second earbud over the second ACL link. In this way, the left andright earbuds of the TWS headset can implement synchronization of thecontrol data based on the second timestamp.

According to a third aspect, this application provides a TWS headset.The TWS headset may include a first earbud and a second earbud. Thefirst earbud and the second earbud may each include a processor, amemory, a wireless communications module, a receiver, and a microphone.The memory, the wireless communications module, the receiver, and themicrophone are coupled to the processor, the memory is configured tostore computer program code, and the computer program code includescomputer instructions. When the processor of the first earbud executesthe computer instructions stored in the memory of the first earbud, thefirst earbud performs the point-to-multipoint data transmission methodaccording to any one of the first aspect or the possible implementationsof the first aspect. When the processor of the second earbud executesthe computer instructions stored in the processor of the second earbud,the second earbud performs the point-to-multipoint data transmissionmethod according to any one of the first aspect or the possibleimplementations of the first aspect.

According to a fourth aspect, this application provides an electronicdevice, which may include: one or more processors, a memory, a wirelesscommunications module, and a mobile communications module. The memory,the wireless communications module, and the mobile communications moduleare coupled to the one or more processors, the memory is configured tostore computer program code, and the computer program code includescomputer instructions. When the one or more processors execute thecomputer instructions, the electronic device performs thepoint-to-multipoint data transmission method according to any one of thesecond aspect or the possible implementations of the second aspect.

According to a fifth aspect, a Bluetooth communications system isprovided. The Bluetooth communications system may include the TWSheadset according to the third aspect and the electronic deviceaccording to the fourth aspect.

According to a sixth aspect, a Bluetooth chip is provided. The Bluetoothchip may include an audio transmission framework, and the audiotransmission framework may include a BLE-based audio profile, a dualdevice manager DDM, an isochronous channel manager ICM, and a directaudio data path DADP. The ICM may be configured to establish anisochronous ISO channel. The DDM may be configured to transmit audiodata on the ISO channel based on the BLE-based audio profile. The DADPmay be configured to encode or decode the audio data transmitted on theISO channel.

In a possible implementation, the ICM may be further configured toreconfigure or delete the ISO channel.

In another possible implementation, the DDM may be further configured tomanage a related procedure of point-to-multipoint data transmissionbetween an electronic device and a TWS headset. For example, the relatedprocedure may include: a pairing connection procedure between theelectronic device and the TWS headset, a primary-secondary switchoverprocedure (or referred to as a role switchover procedure), an audiocapability declaration and discovery procedure, an audio dataconfiguration procedure, a device scheduling and coordination procedure,an encoder parameter negotiation procedure, a state machine managementprocedure, a transmission configuration parameter negotiation procedure,and a content control management procedure.

The ICM may be further configured to provide the DDM with all managementmethods for a data transmission related procedure, for example, defininga specific command and response, and providing an interface for the DDMto use.

The DADP may be further configured to perform processing such as datadistribution, data collection, and synchronous playing of the audio datatransmitted on the ISO channel.

According to a seventh aspect, a computer storage medium is provided,including computer instructions. When the computer instructions run on afirst earbud of a TWS headset, the first earbud is enabled to performthe point-to-multipoint data transmission method according to any one ofthe first aspect or the possible implementations of the first aspect.When the computer instructions run on a second earbud of the TWSheadset, the second earbud is enabled to perform the point-to-multipointdata transmission method according to any one of the first aspect or thepossible implementations of the first aspect.

According to an eighth aspect, a computer storage medium is provided,including computer instructions. When the computer instructions run onan electronic device, the electronic device is enabled to perform thepoint-to-multipoint data transmission method according to any one of thesecond aspect or the possible implementations of the second aspect.

According to a ninth aspect, this application provides a computerprogram product. When the computer program product runs on a computer,the computer is enabled to perform either of the point-to-multipointdata transmission methods.

It may be understood that the TWS headset according to the third aspect,the electronic device according to the fourth aspect, the Bluetoothcommunications system according to the fifth aspect, the Bluetooth chipaccording to the sixth aspect, the computer storage media according tothe seventh aspect and the eighth aspect, and the computer programproduct according to the ninth aspect that are provided above are allconfigured to perform corresponding methods provided above. Therefore,for beneficial effects that can be achieved, refer to beneficial effectsin the corresponding methods provided above. Details are not describedherein again.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic architectural diagram of a Bluetooth audio systemaccording to an embodiment of this application;

FIG. 2 is a schematic structural diagram of an earbud of a TWS headsetaccording to an embodiment of this application;

FIG. 3 is a schematic diagram of an example of a product form of a TWSheadset according to an embodiment of this application;

FIG. 4 is a schematic structural diagram of an electronic deviceaccording to an embodiment of this application;

FIG. 5 is a schematic diagram of an audio transmission frameworkaccording to an embodiment of this application;

FIG. 6 is a schematic diagram of a communications system between amobile phone and a TWS headset according to an embodiment of thisapplication;

FIG. 7 is a schematic diagram of an encoding framework according to anembodiment of this application;

FIG. 8 is a schematic diagram of another encoding framework according toan embodiment of this application;

FIG. 9 is a schematic diagram of still another encoding frameworkaccording to an embodiment of this application;

FIG. 10 is a schematic diagram of still another encoding frameworkaccording to an embodiment of this application;

FIG. 11 is a schematic diagram of still another encoding frameworkaccording to an embodiment of this application;

FIG. 12 is a schematic structural diagram of an earbud of another TWSheadset according to an embodiment of this application; and

FIG. 13 is a schematic structural diagram of another electronic deviceaccording to an embodiment of this application.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

Currently, the Bluetooth technical specification formulated by the SIGincludes some audio profiles, for example, a hands-free profile (handsfree profile, HFP), an advanced audio distribution profile (advancedaudio distribution profile, A2DP), and an audio/video remote controlprofile (audio/video remote control profile, AVRCP).

The HFP is a Bluetooth telephony service protocol. Some extendedfunctions are added to the HFP based on a headset profile (Head SetProfile, HSP), to enable a vehicle-mounted hands-free apparatus tocontrol a mobile phone, for example, answering a call, hanging up acall, rejecting an incoming call, and voice dialing. The HFP may also beused in a scenario in which a personal computer is used as an outputdevice, such as a speaker, of a mobile phone. The HSP is a most commonBluetooth configuration and can provide a basic function required forcommunication between a mobile phone and a Bluetooth headset. Based onthe HSP, the Bluetooth headset may be used as an audio input/outputdevice of the mobile phone.

The A2DP is a Bluetooth audio application protocol, which specifies amethod of stacking data by using a chip in a headset. Based on the A2DP,stereo audio data such as high-quality music can be transmitted betweentwo Bluetooth devices in a Bluetooth mode to achieve high-definitionsounds.

The AVRCP is a Bluetooth audio remote audio control protocol, used tosend control data (or referred to as control commands) such as forward,backward, pause, and play from a controller (such as a stereo headset)to a target device (such as a mobile phone with a music playerinstalled). In the AVRCP, the controller may convert detected useroperations into audio/video (audio/video, A/V) control data and thentransmit the control data to the target device to control the targetdevice. The AVRCP can be used in cooperation with the A2DP.

The audio profiles such as the HFP, the A2DP, and the AVRCP are mainlyused for point-to-point data transmission based on a BR/an EDR.

An embodiment of this application provides a point-to-multipoint datatransmission method. A BR/EDR-based audio profile such as the A2DP, theHFP, or the AVRCP is modified to an audio profile supporting Bluetoothlow energy (Bluetooth low energy, BLE), to implement point-to-multipointdata transmission. In addition, audio data is transmitted based on anisochronous (isochronous, ISO) channel (channel) of BLE, therebyimplementing rendering synchronization of point-to-multipoint audiodata, that is, rendering synchronization of audio data respectivelytransmitted by a mobile phone to left and right earbuds of a TWSheadset.

The ISO channel of BLE defines a transmission mechanism. In thisembodiment of this application, with the transmission mechanism, asource device may send a data stream (stream, for example, audio data)to a plurality of destination devices based on ISO channels of BLE, andrendering synchronization of the data stream between the plurality ofdestination devices can be implemented.

In this embodiment of this application, the rendering synchronization ofthe data stream between the plurality of destination devices may meanthat the plurality of destination devices may separately receive thedata stream from the source device, and for a user, received datastreams can be played at a same time point. For example, the sourcedevice may be a mobile phone, and the plurality of destination devicesmay be left and right earbuds of a TWS headset. When the TWS headset isused as an audio input/output device of the mobile phone, the mobilephone may respectively send audio data to the left and right earbuds ofthe TWS headset based on ISO channels of BLE by using an audio profilesupporting BLE. After receiving the audio data from the mobile phone,the left and right earbuds of the TWS headset can play the receivedaudio data at a same time point perceived by the user. In this way,rendering synchronization of point-to-multipoint audio data isimplemented.

It should be noted that in this embodiment of this application, theaudio data (which may also be referred to as an audio stream) mayinclude voice data in a call process, voice data or a voice message in avoice call or video call process performed by using an application (suchas WeChat (WeChat) or Facebook (Facebook)), an announcement (such as anincoming call announcement or a ringback tone), music, and the like.

In addition, when the TWS headset is used as an input/output device ofthe mobile phone, in addition to a need to transmit the audio data,there may be a need to transmit control data between the mobile phoneand the left and right earbuds of the TWS headset. The control data(which may also be referred to as a control command, content (content)control, or the like) may include media control (media control), callcontrol (call control), volume control (volume control), and the like.The media control may include commands such as pause and play. The callcontrol may include commands such as answering an incoming call, hangingup a call, rejecting an incoming call, voice dialing, holding a call,and callback. The volume control may include commands such as volumedown and volume up.

Similar to rendering synchronization of audio data, in this embodimentof this application, with the audio profile supporting BLE,synchronization of point-to-multipoint control data, that is,synchronization of the control data respectively transmitted by themobile phone to the left and right earbuds of the TWS headset, can alsobe implemented. The control data may be transmitted over an asynchronousconnection-oriented link (asynchronous connection-oriented link, ACL).The synchronization of the control data may mean that the left and rightearbuds of the TWS headset may separately receive the control data fromthe mobile phone, and for the user, corresponding responses can be madeto the control data at a same time point. In other words, the mobilephone can ensure synchronization between the left and right earbuds ofthe TWS headset when the corresponding control data is executed. Forexample, when the TWS headset is used as an audio output device of themobile phone to play music, for the user, the mobile phone can ensurethat the left and right earbuds of the TWS headset synchronously playand pause.

The following describes the implementations of the embodiments of thisapplication in detail with reference to accompanying drawings.

As shown in FIG. 1, the point-to-multipoint data transmission methodprovided in the embodiments of this application may be applied to aBluetooth audio system including a peripheral device 101 and anelectronic device 102.

A Bluetooth connection may be established between the peripheral device101 and the electronic device 102 by using Bluetooth. Based on theestablished Bluetooth connection, short-distance data exchange may beimplemented between the peripheral device 101 and the electronic device102. For example, audio data may be transmitted between the peripheraldevice 101 and the electronic device 102 based on the Bluetoothconnection. For example, based on the Bluetooth connection, theperipheral device 101 may be used as an audio input/output device of theelectronic device 102 to implement a call. For another example, based onthe Bluetooth connection, the peripheral device 101 may be used as anoutput device, such as a speaker, of the electronic device 102, to playmusic.

In some embodiments, the peripheral device 101 may be a device such as aTWS headset, a Bluetooth speaker, or smart glasses. The peripheraldevice 101 includes two bodies, and no cable connection is requiredbetween the two bodies. In addition, for audio data transmitted by theelectronic device 102 to the two bodies of the peripheral device 101,the two bodies are required to implement rendering synchronization ofthe audio data.

In this embodiment of this application, a specific manner in which aBluetooth connection is established between the peripheral device 101and the electronic device 102 by using Bluetooth may be that theelectronic device 102 respectively establishes Bluetooth connections tothe two bodies of the peripheral device 101. Short-distance dataexchange may be respectively implemented between the electronic device102 and the two bodies of the peripheral device 101 based on therespective Bluetooth connections. In an example, FIG. 1 shows a TWSheadset as an example of the peripheral device 101. The TWS headsetincludes two bodies (for example, headset bodies), for example, referredto as a left earbud 101-1 and a right earbud 101-2. The electronicdevice 102 respectively establishes Bluetooth connections to the leftearbud 101-1 and the right earbud 101-2 of the TWS headset, andtransmits data (for example, audio data) based on the respectiveBluetooth connections. In this embodiment of this application,structures of the left earbud 101-1 and the right earbud 101-2 of theTWS headset may be shown in FIG. 2, and are described in detail in thefollowing embodiment.

In some embodiments, the electronic device 102 may be a mobile phone (asshown in FIG. 1), a tablet computer, a desktop computer, a laptopcomputer, a handheld computer, a notebook computer, an ultra-mobilepersonal computer (ultra-mobile personal computer, UMPC), a netbook, acellular phone, a personal digital assistant (personal digitalassistant, PDA), an augmented reality (augmented reality, AR)/virtualreality (virtual reality, VR) device, a media player, a television, orthe like. A specific form of the device is not particularly limited inthis embodiment of this application. In this embodiment of thisapplication, a structure of the electronic device 102 may be shown inFIG. 4, and is described in detail in the following embodiment.

FIG. 2 is a schematic structural diagram of an earbud (a left earbud ora right earbud) of a TWS headset according to an embodiment of thisapplication. As shown in FIG. 2, the earbud of the TWS headset mayinclude: a processor 201, a memory 202, a sensor 203, a wirelesscommunications module 204, at least one receiver 205, at least onemicrophone 206, and a power supply 207.

The memory 202 may be configured to store application program code, forexample, application program code used to establish a Bluetoothconnection to another earbud of the TWS earphone and enable the earbudto be paired with the electronic device 102. The processor 201 maycontrol execution of the application program code, to implement afunction of the earbud of the TWS headset in this embodiment of thisapplication.

The memory 202 may further store a Bluetooth address used to uniquelyidentify the earbud, and store a Bluetooth address of the other earbudof the TWS headset. In addition, the memory 202 may further storeconnection data of an electronic device that is successfully paired withthe earbud before. For example, the connection data may be a Bluetoothaddress of the electronic device successfully paired with the earbud.Based on the connection data, the earbud can be automatically pairedwith the electronic device, and a connection between the earbud and theelectronic device does not need to be configured. For example, validityverification is not required. The Bluetooth address may be a mediaaccess control (Media Access Control, MAC) address.

The sensor 203 may be a distance sensor or an optical proximity sensor.The processor 201 of the earbud may determine, by using the sensor 203,whether the earbud is worn by the user. For example, the processor 201of the earbud may detect, by using the optical proximity sensor, whetherthere is an object near the earbud, to determine whether the earbud isworn by the user. When it is determined that the earbud is worn, theprocessor 201 of the earbud may start the receiver 205. In someembodiments, the earbud may further include a bone conduction sensor, toform a bone conduction earphone. The bone conduction sensor may obtain avibration signal of a vibration bone of a sound part, and the processor201 parses out a speech signal, to implement a control functioncorresponding to the speech signal. In some other embodiments, theearbud may further include a touch sensor or a pressure sensor, todetect a touch operation or a pressing operation of the user. In someother embodiments, the earbud may further include a fingerprint sensor,configured to detect a user fingerprint, identify a user identity, andthe like. In some other embodiments, the earbud may further include anambient optical sensor, and the processor 201 of the earbud mayadaptively adjust some parameters such as volume based on luminance ofambient light sensed by the ambient optical sensor.

The wireless communications module 204 is configured to supportshort-range data exchange between the left and right earbuds of the TWSheadset and between the earbuds and various electronic devices, forexample, the electronic device 102. In some embodiments, the wirelesscommunications module 204 may be a Bluetooth transceiver. The earbud ofthe TWS headset may establish a Bluetooth connection to the electronicdevice 102 by using the Bluetooth transceiver, to implement short-rangedata exchange between the earbud of the TWS headset and the electronicdevice 102.

The receiver 205, also referred to as an “earpiece”, may be configuredto convert an audio electrical signal into a sound signal and play thesound signal. For example, when the earbud of the TWS headset is used asan audio output device of the electronic device 102, the receiver 205may convert a received audio electrical signal into a sound signal andplay the sound signal.

The microphone 206, also referred to as a “mike” or a “microphone”, isconfigured to convert a sound signal into an audio electrical signal.For example, when the earbud of the TWS headset is used as an audioinput device of the electronic device 102, in a process in which theuser speaks (for example, makes a call or sends a voice message), themicrophone 206 may collect a sound signal of the user and convert thesound signal into an audio electrical signal. The audio electricalsignal is the audio data in this embodiment of this application.

The power supply 207 may be configured to supply power to each componentincluded in the earbud of the TWS headset. In some embodiments, thepower supply 207 may be a battery, for example, a rechargeable battery.

Generally, a TWS headset is provided with a headset box (for example,301 shown in FIG. 3). As shown in FIG. 3, the headset box 301 mayinclude a cavity 301-1 and a box cover 301-2. The cavity 301-1 may beconfigured to accommodate the left and right earbuds of the TWS headset.With reference to FIG. 1, as shown in FIG. 3, the cavity 301-1 of theheadset box 301 may be configured to accommodate the left earbud 101-1and the right earbud 101-2 of the TWS headset. In addition, the headsetbox 301 may further charge the left and right earbuds of the TWSheadset. Correspondingly, in some embodiments, the earbud of the TWSheadset may further include an input/output interface 208.

The input/output interface 208 may be configured to provide any wiredconnection between the earbud of the TWS headset and the headset box(for example, the cavity 301-1 of the headset box 301). In someembodiments, the input/output interface 208 may be an electricalconnector. For example, when the earbud of the TWS headset is placed inthe cavity 301-1 of the headset box 301, the earbud of the TWS headsetmay be electrically connected to the headset box 301 (for example, aninput/output interface of the headset box 301) through the electricalconnector. After the electrical connection is established, the headsetbox 301 may charge the power supply 207 of the earbud of the TWSheadset. After the electrical connection is established, the earbud ofthe TWS headset may further perform data communication with the headsetbox 301. For example, the processor 201 of the earbud of the TWS headsetmay receive a pairing instruction from the headset box 301 through theelectrical connection. The pairing command is used to instruct theprocessor 201 of the earbud of the TWS headset to enable the wirelesscommunications module 204, so that the earbud of the TWS headset can bepaired with the electronic device 102 by using a corresponding wirelesscommunications protocol (for example, the Bluetooth).

Certainly, the earbud of the TWS headset may alternatively not includethe input/output interface 208. In this case, the earbud may implement acharging or data communication function based on the Bluetoothconnection established between the earbud and the headset box 301 byusing the wireless communications module 204.

In addition, in some embodiments, the headset box (for example, theheadset box 301) may further include components such as a processor anda memory. The memory may be configured to store application programcode, and the application program code is executed under control of theprocessor of the headset box 301, to implement a function of the headsetbox 301. For example, when the user opens the box cover 301-2 of theheadset box 301, the processor of the headset box 301 may send, byexecuting the application program code stored in the memory, a pairingcommand and the like to the earbud of the TWS headset in response to theoperation of opening the box cover 301-2 by the user.

It may be understood that the structure shown in this embodiment of thisapplication does not constitute a specific limitation on the earbud ofthe TWS headset. The CPE 100 may have more or fewer components thanthose shown in FIG. 2, or may combine two or more components, or mayhave different component configurations. For example, the earbud mayfurther include components such as an indicator (which may indicate astatus such as a battery level of the earbud) and a dust filter (whichmay be used with the earpiece). Various components shown in FIG. 2 maybe implemented in hardware, software, or a combination of hardware andsoftware that includes one or more signal processing orapplication-specific integrated circuits.

It should be noted that structures of the left and right earbuds of theTWS headset may be the same. For example, both the left and rightearbuds of the TWS headset may include the components shown in FIG. 2.Alternatively, the structures of the left and right earbuds of the TWSheadset may be different. For example, one earbud (for example, theright earbud) of the TWS headset may include the components shown inFIG. 2, and the other earbud (for example, the left earbud) may includecomponents other than the microphone 206 in FIG. 2.

FIG. 4 is a schematic structural diagram of an electronic device 102 ina Bluetooth audio system shown in FIG. 1 according to an embodiment ofthis application. As shown in FIG. 4, the electronic device 102 mayinclude a processor 110, an external memory interface 120, an internalmemory 121, a universal serial bus (universal serial bus, USB) interface130, a charging management module 140, a power management module 141, abattery 142, an antenna 1, an antenna 2, a mobile communications module150, a wireless communications module 160, an audio module 170, aspeaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, asensor module 180, a button 190, a motor 191, an indicator 192, a camera193, a display 194, a subscriber identification module (subscriberidentification module, SIM) card interface 195, and the like. The sensormodule 180 may include a pressure sensor 180A, a gyroscope sensor 180B,a barometric pressure sensor 180C, a magnetic sensor 180D, anacceleration sensor 180E, a distance sensor 180F, an optical proximitysensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, atouch sensor 180K, an ambient light sensor 180L, a bone conductionsensor 180M, and the like.

It may be understood that the structure shown in the embodiments of thisapplication does not constitute a specific limitation on the electronicdevice 102. In some other embodiments, the electronic device 102 mayinclude more or fewer components than those shown in the figure, or somecomponents may be combined, or some components may be split, ordifferent component arrangements may be used. The components shown inthe figure may be implemented by hardware, software, or a combination ofsoftware and hardware.

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (applicationprocessor, AP), a modem processor, a graphics processing unit (graphicsprocessing unit, GPU), an image signal processor (image signalprocessor, ISP), a controller, a memory, a video codec, a digital signalprocessor (digital signal processor, DSP), a baseband processor, and/ora neural network processing unit (neural-network processing unit, NPU).Different processing units may be independent components, or may beintegrated into one or more processors.

The controller may be a nerve center and a command center of theelectronic device 102. The controller may generate an operation controlsignal based on instruction operation code and a time sequence signal,to complete control of instruction reading and instruction execution.

A memory may further be disposed in the processor 110, and is configuredto store instructions and data. In some embodiments, the memory in theprocessor 110 is a cache memory. The memory may store instructions ordata just used or cyclically used by the processor 110.

In some embodiments, the processor 110 may include one or moreinterfaces. The interface may include an inter-integrated circuit(inter-integrated circuit, I2C) interface, an inter-integrated circuitsound (inter-integrated circuit sound, I2S) interface, a pulse codemodulation (pulse code modulation, PCM) interface, a universalasynchronous receiver/transmitter (universal asynchronousreceiver/transmitter, UART) interface, a mobile industry processorinterface (mobile industry processor interface, MIPI), a general-purposeinput/output (general-purpose input/output, GPIO) interface, asubscriber identity module (subscriber identity module, SIM) interface,a universal serial bus (universal serial bus, USB) interface, and/or thelike.

It may be understood that an interface connection relationship betweenthe modules shown in this embodiment is merely an example fordescription, and does not constitute a limitation on the structure ofthe electronic device 102. In some other embodiments, the electronicdevice 102 may alternatively use an interface connection mannerdifferent from that in the foregoing embodiment, or a combination of aplurality of interface connection manners.

The charging management module 140 is configured to receive a charginginput from the charger. The charging management module 140 suppliespower to the electronic device through the power management module 141while charging the battery 142.

The power management module 141 is configured to connect the battery 142and the charging management module 140 to the processor 110. The powermanagement module 141 receives an input from the battery 142 and/or thecharging management module 140, and supplies power to the processor 110,the internal memory 121, an external memory, the display 194, the camera193, the wireless communications module 160, and the like. The powermanagement module 141 may further be configured to monitor parameterssuch as a battery capacity, a battery cycle count, and a battery healthstatus (electric leakage or impedance). In some other embodiments, thepower management module 141 may alternatively be disposed in theprocessor 110. In some other embodiments, the power management module141 and the charging management module 140 may alternatively be disposedin a same device.

A wireless communication function of the electronic device 102 may beimplemented through the antenna 1, the antenna 2, the mobilecommunications module 150, the wireless communications module 160, themodem processor, the baseband processor, and the like.

The antenna 1 and the antenna 2 are configured to transmit and receiveelectromagnetic wave signals. The mobile communications module 150 mayprovide a solution that is for wireless communication including2G/3G/4G/5G and the like and that is applied to the electronic device102. The mobile communications module 150 may include at least onefilter, a switch, a power amplifier, a low noise amplifier (low noiseamplifier, LNA), and the like. The mobile communications module 150 mayreceive an electromagnetic wave through the antenna 1, performprocessing such as filtering or amplification on the receivedelectromagnetic wave, and transmit a processed electromagnetic wave tothe modem processor for demodulation. The mobile communications module150 may further amplify a signal modulated by the modem processor, andconvert the signal into an electromagnetic wave for radiation throughthe antenna 1. In some embodiments, at least some function modules ofthe mobile communications module 150 may be disposed in the processor110. In some embodiments, at least some function modules of the mobilecommunications module 150 may be disposed in a same device as at leastsome modules of the processor 110.

The modem processor may include a modulator and a demodulator. In someembodiments, the modem processor may be an independent component. Insome other embodiments, the modem processor may be independent of theprocessor 110, and is disposed in a same device as the mobilecommunications module 150 or another function module.

The wireless communications module 160 may provide wirelesscommunication solutions, applied to the electronic device 102, forexample, wireless local area network (wireless local area networks,WLAN) (such as a wireless fidelity (wireless fidelity, Wi-Fi) network),Bluetooth (Bluetooth, BT), global navigation satellite system (globalnavigation satellite system, GNSS), frequency modulation (frequencymodulation, FM), near field communication (near field communication,NFC), and infrared (infrared, IR) technologies. The wirelesscommunications module 160 may be one or more devices that integrate atleast one communications processing module. The wireless communicationsmodule 160 receives an electromagnetic wave through the antenna 2,performs frequency modulation and filtering processing on theelectromagnetic wave signal, and sends a processed signal to theprocessor 110. The wireless communications module 160 may furtherreceive a to-be-sent signal from the processor 110, perform frequencymodulation and amplification on the signal, and convert the signal intoan electromagnetic wave for radiation through the antenna 2.

In some embodiments, the antenna 1 of the electronic device 102 iscoupled to the mobile communications module 150, and the antenna 2 iscoupled to the wireless communications module 160, so that theelectronic device 102 may communicate with a network and another deviceby using a wireless communications technology. The wirelesscommunications technology may include a global system for mobilecommunications (global system for mobile communications, GSM), a generalpacket radio service (general packet radio service, GPRS), code divisionmultiple access (code division multiple access, CDMA), wideband codedivision multiple access (wideband code division multiple access,WCDMA), time-division code division multiple access (time-division codedivision multiple access, TD-SCDMA), long term evolution (long termevolution, LTE), BT, a GNSS, a WLAN, NFC, FM, an IR technology, and/orthe like. The GNSS may include a global positioning system (globalpositioning system, GPS), a global navigation satellite system (globalnavigation satellite system, GLONASS), a BeiDou navigation satellitesystem (beidou navigation satellite system, BDS), a quasi-zenithsatellite system (quasi-zenith satellite system, QZSS), and/or asatellite-based augmentation system (satellite based augmentationsystems, SBAS). For example, in this embodiment of this application, theelectronic device 102 may establish a Bluetooth connection to theperipheral device through the wireless communications module 160 byusing the wireless communications technology such as the Bluetooth (BT).Based on the established Bluetooth connection, the electronic device 102may send voice data to the peripheral device, and may further receivevoice data from the peripheral device.

The electronic device 102 implements a display function through the GPU,the display 194, the application processor, and the like. The GPU is amicroprocessor for image processing, and connects the display 194 to theapplication processor. The processor 110 may include one or more GPUsthat execute program instructions to generate or change displayinformation.

The display 194 is configured to display an image, a video, and thelike. The display 194 includes a display panel. The display panel may bea liquid crystal display (liquid crystal display, LCD), an organiclight-emitting diode (organic light-emitting diode, OLED), anactive-matrix organic light emitting diode (active-matrix organic lightemitting diode, AMOLED), a flexible light-emitting diode (flexlight-emitting diode, FLED), a mini-LED, a micro-LED, a micro-OLED, aquantum dot light emitting diode (quantum dot light emitting diodes,QLED), or the like. In some embodiments, the electronic device 102 mayinclude one or N displays 194, where N is a positive integer greaterthan 1.

The electronic device 102 may implement a photographing function throughthe ISP, the camera 193, the video codec, the GPU, the display 194, theapplication processor, and the like.

The ISP is configured to process data fed back by the camera 193. Insome embodiments, the ISP may be disposed in the camera 193. The camera193 is configured to capture a static image or a video. In someembodiments, the electronic device 102 may include one or N cameras 193,where N is a positive integer greater than 1. The video codec isconfigured to compress or decompress a digital video. The electronicdevice 102 may support one or more video codecs.

The external memory interface 120 may be configured to connect to anexternal memory card, for example, a micro SD card, to extend a storagecapability of the electronic device 102. The external storage cardcommunicates with the processor 110 through the external memoryinterface 120, to implement a data storage function. For example, filessuch as music and a video are stored in the external storage card.

The internal memory 121 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theprocessor 110 runs the instructions stored in the internal memory 121 toexecute various function applications of the electronic device 102 anddata processing. For example, in this embodiment of this application,the processor 110 may execute the instructions stored in the internalmemory 121, to establish the Bluetooth connection with the peripheraldevice through the wireless communications module 160, and performshort-range data exchange with the peripheral device, to implementfunctions such as calling and music playing by using the peripheraldevice. The internal memory 121 may include a program storage area and adata storage area. The program storage area may store an operatingsystem, an application required by at least one function (for example, asound playing function or an image playing function), and the like. Thedata storage area may store data (such as audio data and an addressbook) created during use of the electronic device 102, and the like. Inaddition, the internal memory 121 may include a high-speed random accessmemory, or may include a non-volatile memory such as at least onemagnetic disk storage device, a flash storage device, or a universalflash storage (universal flash storage, UFS). In this embodiment of thisapplication, after the Bluetooth connection is established between theelectronic device 102 and the peripheral device by using the wirelesscommunications technology such as the Bluetooth, the electronic device102 may store a Bluetooth address of the peripheral device in theinternal memory 121. In some embodiments, when the peripheral device isa device including two main bodies, for example, a TWS headset, and leftand right earbuds of the TWS headset have respective Bluetoothaddresses, the electronic device 102 may store the Bluetooth addressesof the left and right earbuds of the TWS headset in the internal memory121 in an associated manner.

The electronic device 102 may implement audio functions, for example,music playback and recording, by using the audio module 170, the speaker170A, the receiver 170B, the microphone 170C, the headset jack 170D, theapplication processor, and the like.

The audio module 170 is configured to convert digital audio informationinto an analog audio signal for output, and is also configured toconvert an analog audio input into a digital audio signal. The audiomodule 170 may be further configured to encode and decode an audiosignal. In some embodiments, the audio module 170 may be disposed in theprocessor 110, or some function modules of the audio module 170 aredisposed in the processor 110.

The speaker 170A, also referred to as a “loudspeaker”, is configured toconvert an audio electrical signal into a sound signal. The electronicdevice 102 may listen to music or answer a hands-free call through thespeaker 170A.

The receiver 170B, also referred to as an “earpiece”, is configured toconvert an audio electrical signal into a sound signal. When a call isanswered or voice information is received by using the electronic device102, the receiver 170B may be put close to a human ear to receive avoice.

The microphone 170C, also referred to as a “mike” or a “microphone”, isconfigured to convert a sound signal into an electrical signal. Whenmaking a call or sending voice information, a user may make a sound nearthe microphone 170C, to input a sound signal to the microphone 170C. Atleast one microphone 170C may be disposed in the electronic device 102.In some other embodiments, two microphones 170C may be disposed in theelectronic device 102, to implement a noise reduction function, inaddition to collecting a sound signal. In some other embodiments, three,four, or more microphones 170C may alternatively be disposed in theelectronic device 102, to collect a sound signal and reduce noise. Themicrophones may further identify a sound source, to implement adirectional recording function, and the like.

In this embodiment of this application, when the Bluetooth connection isestablished between the electronic device 102 and the peripheral device,for example, the TWS headset, the TWS headset may be used as an audioinput/output device of the electronic device 102. For example, the audiomodule 170 may receive an audio electrical signal transmitted by thewireless communications module 160, to implement functions such as callanswering and music playing by using the TWS headset. For example, in aprocess in which the user makes a call, the TWS headset may collect asound signal of the user, convert the sound signal into an audioelectrical signal, and send the audio electrical signal to the wirelesscommunications module 160 of the electronic device 102. The wirelesscommunications module 160 transmits the audio electrical signal to theaudio module 170. The audio module 170 may convert the received audioelectrical signal into a digital audio signal, encode the digital audiosignal, and then transfer an encoded digital audio signal to the mobilecommunications module 150. The mobile communications module 150transmits the encoded digital audio signal to a peer device of the call,to implement the call. For another example, when the user plays music byusing the media player of the electronic device 102, the applicationprocessor may transmit, to the audio module 170, an audio electricalsignal corresponding to the music played by the media player. The audiomodule 170 transmits the audio electrical signal to the wirelesscommunications module 160. The wireless communications module 160 maysend the audio electrical signal to the TWS headset, so that the TWSheadset converts the audio electrical signal into a sound signal forplaying.

The headset jack 170D is configured to connect to a wired headset. Theheadset jack 170D may be the USB interface 130, or may be a 3.5-mm openmobile terminal platform (open mobile terminal platform, OMTP) standardinterface, or a cellular telecommunications industry association of theUSA (cellular telecommunications industry association of the USA, CTIA)standard interface.

The pressure sensor 180A is configured to sense a pressure signal, andmay convert the pressure signal into an electrical signal. In someembodiments, the pressure sensor 180A may be disposed on the display194. There are a plurality of types of pressure sensors 180A such as aresistive pressure sensor, an inductive pressure sensor, and acapacitive pressure sensor. When a force is applied to the pressuresensor 180A, capacitance between electrodes changes. The electronicdevice 102 determines pressure intensity based on a capacitance change.When a touch operation is performed on the display 194, the electronicdevice 102 detects intensity of the touch operation by using thepressure sensor 180A. The electronic device 102 may further calculate atouch position based on a detection signal of the pressure sensor 180A.In some embodiments, touch operations that are performed in a same touchposition but have different touch operation intensity may correspond todifferent operation instructions. For example, when a touch operationwhose touch operation intensity is less than a first pressure thresholdis performed on an SMS message application icon, an instruction forviewing an SMS message is executed. When a touch operation whose touchoperation intensity is greater than or equal to the first pressurethreshold is performed on an SMS message application icon, aninstruction for creating a new SMS message is executed.

The gyroscope sensor 180B may be configured to determine a motionposture of the electronic device 102. The gyroscope sensor 180B may befurther used in navigation and motion-sensing game scenarios. Thebarometric pressure sensor 180C is configured to measure barometricpressure. The magnetic sensor 180D includes a Hall sensor. Theacceleration sensor 180E may detect accelerations in various directions(usually on three axes) of the electronic device 102. The distancesensor 180F is configured to measure a distance. The electronic device102 may detect, by using the optical proximity sensor 180G, that theuser holds the electronic device 102 close to an ear for a call, toautomatically turn off a screen for power saving. The optical proximitysensor 180G may also be used in a smart cover mode or a pocket mode toautomatically unlock or lock the screen. The ambient light sensor 180Lis configured to sense ambient light brightness. The ambient lightsensor 180L may also be configured to automatically adjust white balanceduring photographing. The ambient light sensor 180L may furthercooperate with the optical proximity sensor 180G to detect whether theelectronic device 102 is in a pocket, to avoid an accidental touch. Thefingerprint sensor 180H is configured to collect a fingerprint. Theelectronic device 102 may use a feature of the collected fingerprint toimplement fingerprint-based unlocking, application lock access,fingerprint-based photographing, fingerprint-based call answering, andthe like. The temperature sensor 180J is configured to detect atemperature. The touch sensor 180K is also referred to as a “touchpanel”. The touch sensor 180K may be disposed on the display 194, andthe touch sensor 180K and the display 194 form a touchscreen, which isalso referred to as a “touch screen”. The touch sensor 180K isconfigured to detect a touch operation performed on or near the touchsensor 180K. The touch sensor may transfer the detected touch operationto the application processor, to determine a type of a touch event. Thedisplay 194 may provide a visual output related to the touch operation.In some other embodiments, the touch sensor 180K may alternatively bedisposed on a surface of the electronic device 102 at a positiondifferent from that of the display 194. The bone conduction sensor 180Mmay obtain a vibration signal. The bone conduction sensor 180M may alsobe in contact with a human pulse, to receive a blood pressure beatingsignal. The application processor may parse heart rate information basedon the blood pressure beating signal obtained by the bone conductionsensor 180M, to implement a heart rate detection function.

The buttons 190 include a power button, a volume button, and the like.The button 190 may be a mechanical button, or or may be a touch button.The electronic device 102 may receive a key input, and generate a keysignal input related to a user setting and function control of theelectronic device 102. The motor 191 may generate a vibration prompt.The motor 191 may be configured to provide an incoming call vibrationprompt and a touch vibration feedback. The indicator 192 may be anindicator light, and may be configured to indicate a charging status anda power change, or may be configured to indicate a message, a missedcall, a notification, and the like. The SIM card interface 195 isconfigured to connect to a SIM card. The SIM card may be inserted in theSIM card interface 195 or removed from the SIM card interface 195, toimplement contact with or separation from the electronic device 102. Theelectronic device 102 may support one or N SIM card interfaces, where Nis a positive integer greater than 1. The electronic device 102interacts with a network by using the SIM card, to implement functionssuch as calling and data communication.

FIG. 5 is a schematic diagram of an audio transmission frameworkaccording to an embodiment of this application. The audio transmissionframework is applied to a Bluetooth device. The Bluetooth device may bethe electronic device 102, for example, a mobile phone. Alternatively,the Bluetooth device may be the peripheral device 101, for example, aTWS headset. The audio transmission framework may be separately appliedto left and right earbuds of the TWS headset to implement wirelesscommunication with another Bluetooth device that uses the audiotransmission framework, for example, the electronic device 102.

The following describes the audio transmission framework in detail. Asshown in FIG. 5, the audio transmission framework may include threelayers: an audio profile (Audio profile) layer, a core (core) layer, anda controller (controller) layer.

The audio profile layer may include an A2DP, an AVRCP, an HFP, and adual device manager (dual device manager, DDM).

Descriptions of the A2DP, the AVRCP, and the HFP are respectively thesame as descriptions of the A2DP, the AVRCP, and the HFP in theforegoing embodiments. In addition, in the audio transmission frameworkprovided in this embodiment of this application, the A2DP, the AVRCP,and the HFP are audio profiles supporting BLE. These audio profilessupporting BLE can enable point-to-multipoint data transmission betweenthe electronic device 102 and the two bodies of the peripheral device101. In addition, these audio profiles supporting BLE can enablesynchronization of point-to-multipoint control data between theelectronic device 102 and the two bodies of the peripheral device 101.

The DDM may be configured to manage a related procedure ofpoint-to-multipoint data transmission between the electronic device 102and the peripheral device 101. For example, the related procedure mayinclude: a pairing connection procedure between the electronic device102 and the peripheral device 101, where the electronic device 102 mayseparately pair up with and connect to the two bodies (for example, leftand right earbuds of a TWS headset) of the peripheral device 101; aprimary-secondary switchover procedure (or referred to as a roleswitchover procedure), where the electronic device 102 may define rolesof the two bodies of the peripheral device 101, for example, theperipheral device 101 is a TWS headset, the electronic device 102 mayrespectively define a left or right earbud of the TWS headset as aprimary earbud or a secondary earbud, and the roles of the left andright earbuds may need to be switched subsequently; an audio capabilitydeclaration and discovery procedure, where the electronic device 102 andthe peripheral device 101 can implement communication based on acorresponding audio profile only when a same audio profile is supported,and the audio capability declaration and discovery procedure may supportaudio capability negotiation between the electronic device 102 and theperipheral device 101; an audio data configuration procedure; a devicescheduling and coordination procedure; an encoder parameter negotiationprocedure; a state machine management procedure; a transmissionconfiguration parameter negotiation procedure, where the electronicdevice 102 and the peripheral device 101 may configure, by using thetransmission configuration parameter negotiation procedure, a channelrequired for transmitting audio data, for example, an ISO channel; and acontent control management procedure, where control data may beexchanged between the electronic device 102 and the peripheral device101 by using the content control management procedure.

The core layer may include: synchronous connection-oriented/extendedsynchronous connection-oriented (synchronousconnection-oriented/extended SCO, SCO/eSCO), an audio/video distributiontransport protocol (audio/video distribution transport protocol, AVDTP),an audio/video control transport protocol (audio/video control transportprotocol, AVCTP), a service discovery protocol (service discoveryprotocol, SDP), a radio frequency communications protocol (radiofrequency communications protocol, RFCOMM), a generic access profile(generic access profile, GAP), a generic attribute profile (genericattribute profile, GATT), an attribute protocol (attribute protocol,ATT), a logical link control and adaptation protocol (logical linkcontrol and adaptation protocol, L2CAP), and an isochronous channelmanager (isochronous channel manager, ICM).

SCO/eSCO is a connection-oriented synchronous transmission link based ona BR/an EDR, and can serve a logical link (logical link) of audio dataat the BR/EDR.

The AVDTP is a protocol used to describe audio/video transmissionbetween Bluetooth devices, which is a basic protocol of the A2DP.

The AVCTP describes a format and a mechanism for audio/video controldata exchange between Bluetooth devices. The AVCTP specifies only ageneral format of control data and responses (response). A specificformat of the control data is implemented by a protocol (such as theAVRCP) specified by the AVCTP.

The SDP may be used as a basis of all profiles. Any Bluetooth profile isimplemented based on some services. In a Bluetooth wirelesscommunications system, any two or more devices between which a Bluetoothconnection is established may start to communicate at any time. Forcommunication between these devices, the SDP may provide a manner ofdynamically querying for a profile supported by a device. Based on theSDP, a device can obtain information and a service type of a peer devicethrough dynamic query to establish a communication channel correspondingto a required service.

The RFCOMM provides a serial emulation interface (serial emulation API),which includes emulation of data signal lines and non-data signal lines.The RFCOMM can emulate a plurality of serial ports between two devicesand support emulation of a plurality of serial port between a pluralityof devices, and also provides emulation of modems.

The GAP is a basis of a Bluetooth profile, which ensures that differentBluetooth devices can discover each other and establish a connection.The GAP may be used to process some general-mode services (such asinquiry, naming, and search) and some security issues (such asguarantee), and may also be used to process some connection-relatedservices (such as link setup and channel and connection establishment).

The GATT is constructed based on the ATT and establishes some commonoperations and frameworks for the attribute protocol to transfer andstore data.

The ATT is a basis of the GATT and the GAP, and defines a data structureand an organization mode of an upper layer of BLE. An attribute(attribute) concept is the core of the ATT. The ATT defines content ofan attribute and specifies a method and a permission to access theattribute.

The L2CAP is an adaptation protocol that shields a baseband protocol fora higher-layer protocol, which is located above the baseband protocoland belongs to a data link layer. The L2CAP may provideconnection-oriented and connectionless data services for a higher layer,and implement functions such as protocol multiplexing, segmentation andreassembly, quality of service (quality of service, QoS) transmission,and group abstraction.

The ICM may be configured to establish, reconfigure, and delete an ISOchannel for carrying audio data. The ICM may further provide the DDMwith all management methods for a data transmission related procedure,for example, defining a specific command and response, and providing aninterface for the DDM to use. For example, the ICM may provide the DDMwith definitions of specific commands and responses required to managethe pairing connection procedure.

The controller layer may include: a BR/an EDR, BLE, an ISO channel(channel), and pulse code modulation (pulse code modulation, PCM).

In this embodiment of this application, the ISO channel is a BLE-basedISO channel, which can cooperate with the audio profile supporting BLE,to implement point-to-multipoint data transmission and implementrendering synchronization of audio data between the bodies (for example,the left and right earbuds of the TWS headset) of the peripheral device101.

PCM is a modulation mode used for transmitting audio data. For example,after being received by the mobile communications module of the mobilephone, audio data in a call process may be transmitted to the wirelesscommunications module of the mobile phone, for example, a Bluetoothchip, after PCM processing. Then, the Bluetooth chip transmits the audiodata by using 2.4 G to the peripheral device, such as the earbuds of theTWS headset.

As shown in FIG. 5, the audio transmission framework may further includea direct audio data path (direct audio data path, DADP). The DADPbelongs to the audio profile layer and the core layer. The DADP may beconfigured to provide a function of managing direct data. For example,the DADP provides processing such as audio encoding, audio decoding,data distribution, data collection, and synchronous playing of audiodata transmitted on BLE-based ISO channels.

In this embodiment of this application, based on the audio transmissionframework, point-to-multipoint data transmission can be implementedbetween the electronic device 102 and the peripheral device 101 by usingan audio profile supporting BLE, such as the A2DP, the AVRCP, and theHFP, in cooperation with the DDM. The electronic device 102 mayrespectively send audio data to the two bodies (for example, the leftand right earbuds of the TWS headset) of the peripheral device 101through ISO channels created by the ICM, and rendering synchronizationof the audio data can be implemented between the two bodies of theperipheral device 101. Processing such as encoding and decoding of theaudio data may be completed by the DADP. In addition, with the audioprofile supporting BLE, synchronization of control data can also beimplemented between the electronic device 102 and the two bodies of theperipheral device 101.

For ease of understanding, the following describes in detail thepoint-to-multipoint data transmission method provided in the embodimentsof this application with reference to accompanying drawings. Referringto FIG. 6, the following embodiments are all described by using anexample in which the electronic device is a mobile phone, the peripheraldevice is a TWS headset, and the TWS headset includes a left earbud anda right earbud. The left earbud may be a first earbud in thisapplication, and the right earbud may be a second earbud in thisapplication. Alternatively, the left earbud may be a second earbud inthis application, and the right earbud may be a first earbud in thisapplication.

The left earbud and the right earbud of the TWS headset may separatelypair up with the mobile phone.

For example, when a user wants to use the TWS headset, the user may opena cover of a headset box of the TWS headset. The left and right earbudsof the TWS headsets automatically start, or the user presses a functionkey to start the earbuds. If the left and right earbuds have notcompleted pairing before, the left and right earbuds may automaticallyperform pairing, or the left and right earbuds may perform pairing afterthe user presses a pairing function key. If the left and right earbudshave completed pairing, the pairing process can be omitted. Then, either(such as the right earbud) of the left earbud and the right earbud ofthe TWS headset may send a pairing broadcast. If a Bluetooth function onthe mobile phone has been enabled, the mobile phone may receive thepairing broadcast and inform the user that a related Bluetooth device(such as the TWS headset) has been obtained through scanning. After theuser selects the TWS headset as a to-be-connected device, the mobilephone may pair up with the right earbud of the TWS headset.

After the right earbud pairs up with the mobile phone, the right earbudmay send a Bluetooth address of the mobile phone to the left earbud byusing a Bluetooth connection between the right earbud and the leftearbud, and notify the left earbud to send a pairing broadcast. In thisway, the mobile phone may receive the pairing broadcast sent by the leftearbud and pair up with the left earbud.

The right earbud of the TWS headset may further send a Bluetooth addressof the left earbud to the mobile phone, to indicate to the mobile phonethat the left earbud and the right earbud are two bodies of a sameperipheral device. When audio data needs to be transmitted to the leftand right earbuds of the TWS headset subsequently, the mobile phone mayrespectively transmit the audio data to the right earbud and the leftearbud based on ISO channels of BLE, to implement renderingsynchronization of the audio data between the right earbud and the leftearbud.

It should be noted that the foregoing process of pairing up with themobile phone by the left earbud and the right earbud of the TWS headsetis merely an example. In some embodiments, the mobile phone mayalternatively pair up with the left earbud of the TWS headset first, andthen the left earbud sends the Bluetooth address of the mobile phone tothe right earbud, and notifies the right earbud to send a pairingbroadcast, so that the right earbud pairs up with the mobile phone. Insome other embodiments, when the cover of the headset box of the TWSheadset is opened, the left earbud and the right earbud of the TWSheadset may each send a pairing broadcast after starting, so that theleft earbud and the right earbud can each pair up with the mobile phone.In addition, a trigger condition for the left earbud or the right earbudof the TWS headset to send a pairing broadcast may be that the cover ofthe headset box of the TWS headset is opened or the pairing function keyis pressed, as described in the foregoing embodiment, or may be anothertrigger condition. The pairing function key may be disposed on theheadset box of the TWS headset. For example, the pairing function key isconfigured on the headset box of the TWS headset. When the pairingfunction key is pressed, the left earbud or the right earbud of the TWSheadset may send a pairing broadcast. The pairing function key may alsobe disposed on the left and right earbuds of the TWS headset. Forexample, the pairing function key is disposed on the left earbud and/orthe right earbud of the TWS headset. When the pairing function key ispressed, a corresponding earbud sends a pairing broadcast.

After pairing up with the left earbud and the right earbud of the TWSheadset, the mobile phone may separately perform service contentnegotiation with the left earbud and the right earbud.

For example, the mobile phone performs service content negotiation withthe left earbud. The mobile phone may send an SDP service request to theleft earbud to obtain a service type supported by the left earbud. Afterreceiving the SDP service request, the left earbud returns the servicetype supported by the left earbud to the mobile phone. Similarly, themobile phone may perform service content negotiation with the rightearbud, to obtain a service type supported by the right earbud. Forexample, in this embodiment of this application, the mobile phone, theleft earbud, and the right earbud may support BLE-based audio profilessuch as the HFP, the A2DP, and the AVRCP. By using these BLE-based audioprofiles, point-to-multipoint data transmission between the mobile phoneand the left and right earbuds of the TWS headset can be implemented.

After the mobile phone pairs up with the left earbud and the rightearbud of the TWS headset, the mobile phone may further set up ACL linksto the left earbud and the right earbud respectively.

For example, as shown in FIG. 6, the mobile phone may set up an ACL link1 to the left earbud, and the mobile phone may set up an ACL link 2 tothe right earbud. The ACL link 1 may be a first ACL link in thisapplication. The ACL link 2 may be a second ACL link in thisapplication. For example, the mobile phone sets up the ACL link 1 to theleft earbud. The mobile phone may send an ACL link setup request to theleft earbud. The left earbud makes a response after receiving the ACLlink setup request. After the mobile phone receives the response fromthe left earbud, the ACL link 1 is set up successfully.

The mobile phone may configure respective ISO channels by using the ACLlinks to the left and right earbuds of the TWS headset.

For example, as shown in FIG. 6, the mobile phone may configure an ISOchannel 1 between the mobile phone and the left earbud by using the ACLlink 1 and configure an ISO channel 2 between the mobile phone and theright earbud by using the ACL link 2. The ISO channel 1 may be a firstISO channel in this application. The ISO channel 2 may be a second ISOchannel in this application.

For example, the mobile phone configures the ISO channel 1 between themobile phone and the left earbud by using the ACL link 1. The mobilephone may send, to the left earbud of the TWS headset over the ACL link1, a request (request) message carrying a parameter required forconfiguring the ISO channel 1. After receiving the request message, theleft earbud may return a response (response) message to the mobilephone, to acknowledge to the mobile phone that the parameter requiredfor configuring the ISO channel 1 has been received. After receiving theresponse message, the mobile phone may send an indication (indication,IND) message to the left earbud. In this way, the mobile phone mayconfigure the ISO channel 1 to the left earbud based on thecorresponding parameter.

After the mobile phone and the left and right earbuds of the TWS headsetconfigure the respective ISO channels, with the BLE-based audio profilesobtained after the negotiation and the configured ISO channels,point-to-multipoint data transmission between the mobile phone and theleft and right earbuds of the TWS headset can be implemented, andrendering synchronization of audio data between the right earbud and theleft earbud can be implemented. In addition, synchronization of controldata between the mobile phone and the left and right earbuds of the TWSheadset can also be implemented.

The following describes a point-to-multipoint data transmission processbetween the mobile phone and the left and right earbuds of the TWSheadset by using specific examples.

For example, with reference to FIG. 5 and FIG. 6, the TWS headset isused as an audio output device of the mobile phone to play music. Whenthe user opens the media player in the mobile phone to play music, themobile phone may encode audio data corresponding to the music played bythe media player, and then separately send the encoded audio data to theleft and right earbuds of the TWS headset.

In some embodiments, referring to FIG. 7, a process in which the mobilephone encodes audio data may specifically include the following steps.

The media player of the mobile phone may transmit audio data (forexample, referred to as audio data 1) corresponding to the currentlyplayed music to the audio profile layer.

The DDM at the audio profile layer may encode the audio data 1 withreference to a BLE-based audio profile, that is, the A2DP. For example,audio data 2 is obtained after the audio data 1 is encoded. The DDMtransmits the audio data 2 to the DADP. For a specific implementation ofencoding the audio data 1 based on the A2DP by the DDM, refer to anexisting implementation of encoding audio data based on the A2DP.Details are not described herein in this embodiment of this application.

The DADP encodes the received audio data 2. For example, audio data 3 isobtained after the audio data 2 is encoded. The DADP adds a packetheader to the audio data 3, to package the audio data 3 into a payload(payload) in a “packet header+audio data” format. In this embodiment ofthis application, the packet header may include the following fields: aserial number (Serial Number, SN), a timestamp (timestamp), and apayload length (payload length). The payload length is a length of theaudio data 3. The SN and the payload length may be used to determinewhether a packet loss occurs in packets. When a packet loss occurs, theSN and the payload length may be further used for corresponding packetloss compensation. The timestamp may be used for a receiving device(such as the left and right earbuds of the TWS headset) to determine atime for playing the audio data. The timestamp may be a first timestampin this application.

The DADP transmits the packaged payload to the controller layer by usinga host controller interface protocol (Host Controller InterfaceProtocol, HCI). The HCI is a layer protocol located between the corelayer and the controller layer, which may provide an upper-layerprotocol with a unified interface to enter a link layer and a unifiedmanner to enter a baseband. Both the link layer and the baseband maybelong to the controller layer.

The controller layer may add a frame header (frame header) to thepayload. For example, the frame header may include an access address(access address). The access address may be used to indicate an identityof the receiving device. In some embodiments, the access address may beused to indicate an identity of the left earbud of the TWS headset andan identity of the right earbud. The frame header may further include anidentifier or the like used to indicate that the packet is a data packetrather than a control packet. It should be noted that, processingperformed by the controller layer on the payload transmitted from theupper layer may include, but is not limited to, the foregoing processingof adding a frame header. For example, the controller layer may furtheradd a frame tail (frame tail) to the payload. The frame trailer mayinclude a check code or the like. For example, the check code may be acyclic redundancy check (Cyclic Redundancy Check, CRC) 24. The checkcode may be used to check the packet. For another example, thecontroller layer may further add a 1-byte preamble (preamble) to thepayload, to improve modulation and demodulation efficiency.

After the foregoing layer-by-layer processing is performed, the audiodata corresponding to the music currently played by the media player,that is, the audio data 1, is packaged into a packet meeting BLE, forexample, referred to as a packet 1. For a data format of the packet 1,refer to FIG. 7 (the frame trailer and the preamble are not shown inFIG. 7). The packet 1 may be a first packet in this application. Themobile phone may respectively send the packet 1 to the left and rightearbuds of the TWS headset through the ISO channels. For example,referring to FIG. 6, the mobile phone sends the packet 1 to the leftearbud through the ISO channel 1, and sends the packet 1 to the rightearbud through the ISO channel 2. In some embodiments, the accessaddress in the frame header added by the controller layer to the payloadmay alternatively be used to indicate only an identity of one earbud ofthe TWS headset. In other words, two different access addresses are usedto respectively indicate identities of the left and right earbuds of theTWS headset. In this case, the mobile phone may separately encode theaudio data that needs to be sent to the left and right earbuds, togenerate packets corresponding to the left and right earbuds, and thensend the packets to the corresponding earbuds by using respective ISOchannels to the left and right earbuds.

It should be noted that the foregoing audio data encoding process ismerely an example, and a specific implementation of the process is notlimited in this embodiment of this application. In other words,processing such as encoding and adding a packet header to the audio datadelivered by the upper-layer application may not be implemented by thecorresponding layer in the foregoing example. For example, theprocessing of encoding the audio data with reference to the A2DP may beimplemented by the controller layer instead of the DDM at the audioprofile layer.

After the mobile phone sends the packet 1, the left and right earbuds ofthe TWS headset may separately receive the packet 1 from the mobilephone. The left and right earbuds of the TWS headset may separatelydecode and play the received packet 1.

In some embodiments, for example, the left earbud of the TWS headsetdecodes the received packet 1. A specific process in which the leftearbud decodes the packet 1 may include the following steps.

After the left earbud of the TWS headset receives the packet 1 throughthe ISO channel 1, the controller layer of the left earbud maydetermine, based on the frame header (for example, the access addressincluded in the frame header) in the packet 1, whether the packet 1 is apacket sent to the left earbud. If the packet 1 is a packet sent to theleft earbud, the left earbud may continue to perform subsequentprocessing on the packet 1. If the packet 1 is not a packet sent to theleft earbud, the left earbud may discard the received packet 1. Thecontroller layer of the left earbud may further determine, based on acorresponding identifier carried in the frame header of the packet 1,that the packet 1 is a data packet. In addition, the packet 1 may befurther checked based on the check code included in the frame trailer ofthe packet 1, to ensure correctness and integrity of data transmission.After the processing is completed, the controller layer of the leftearbud may transmit the payload in the packet 1 to the DADP of the leftearbud by using the HCI of the left earbud.

After receiving the payload, the DADP may parse out the packet headerand the audio data 3 in the received payload. The DADP may determine,based on the SN and the payload length in the packet header, whether apacket loss occurs in packets. If a packet loss occurs, the DADP mayfurther perform corresponding packet loss compensation based on the SNand the payload length. In addition, the DADP may further determine,based on the timestamp in the packet header, the time for playing theaudio data. The DADP may further decode the audio data 3, for example,decode the audio data 3 to obtain the audio data 2. The DADP transmitsthe audio data 2 obtained through the decoding to the DDM at the audioprofile layer of the left earbud.

The DDM decodes the audio data 2 with reference to a BLE-based audioprofile obtained after the negotiation, that is, the A2DP, for example,decodes the audio data 2 to obtain the audio data 1.

After the foregoing layer-by-layer processing is performed, the leftearbud of the TWS headset may obtain audio data that needs to be played,for example, the audio data 1. Similarly, the right earbud of the TWSheadset may also process the received packet 1 to obtain the audio data1 that needs to be played. In addition, in the foregoing processingprocess, the left and right earbuds of the TWS headset may furtherobtain times for playing the audio data. The left and right earbuds ofthe TWS headset may play the respectively obtained audio data based onthe obtained playing times. The times for playing the audio data thatare obtained by the left and right earbuds of the TWS headset are thesame. In this way, point-to-multipoint data transmission can beimplemented between the mobile phone and the left and right earbuds ofthe TWS headset, and rendering synchronization of the audio data canalso be implemented between the left and right earbuds of the TWSheadset.

It should be noted that the foregoing example is described by using anexample in which the mobile phone sends same audio data, for example,the audio data 1, to the left and right earbuds. For stereo audio data,the mobile phone may send different audio data to the left and rightearbuds. For example, the mobile phone sends left channel audio data tothe left earbud of the TWS headset, and sends right channel audio datato the right earbud. In this case, the mobile phone may separatelyencode the audio data that needs to be sent to the left and rightearbuds. An encoding process is similar to the encoding process in theforegoing example, and details are not described herein again. Thissolution of sending the left channel audio data to the left earbud andsending the right channel audio data to the right earbud reduces anamount of data transmitted between devices, as compared with a solutionof transmitting the stereo audio data to both the left earbud and theright earbud. For example, for stereo audio data at a bit rate of 300kbit/second (kbps), in this embodiment of this application, left channelaudio data and right channel audio data each at a bit rate of about 150kbps may be respectively sent to the left and right earbuds of the TWSheadset. Compared with separately sending the audio data at the bit rateof 300 kbps to the left and right earbuds, the data transmission isreduced by about half. In addition, because the data received by theleft and right earbuds is reduced, radio frequency receivers of the leftand right earbuds correspondingly work less. In this way, powerconsumption of the left and right earbuds can be reduced, and the leftand right earbuds can have a longer standby time. Because the audio bitrate of the left and right earbuds decreases, a probability ofinterference in a radio environment can also be reduced.

In some other embodiments, when the TWS headset is used as an audiooutput device of the mobile phone to play music, in addition to theaudio data, control data of commands such as play and pause may betransmitted between the mobile phone and the TWS headset. In thisembodiment of this application, based on the audio transmissionframework shown in FIG. 5, synchronization of point-to-multipointcontrol data can also be implemented between the mobile phone and theleft and right earbuds of the TWS headset by using an audio profilesupporting BLE. In other words, for the user, the mobile phone canensure that the left and right earbuds of the TWS headset synchronouslyplay/pause. For example, with reference to FIG. 5 and FIG. 6, the mobilephone currently plays music by using the TWS headset, and the userperforms a pause operation on the mobile phone. The mobile phone mayreceive the pause operation of the user. For example, the pauseoperation may be a tapping operation performed by the user on a pausebutton in an interface of the media player displayed on the mobilephone. In response to the pause operation, the mobile phone mayseparately send a pause command to the left and right earbuds of the TWSheadset. Before sending the pause command, the mobile phone may encodethe pause command.

In some embodiments, referring to FIG. 8, a process in which the mobilephone encodes the pause command may specifically include the followingsteps.

For example, the pause operation is a tapping operation performed by theuser on the pause button in the interface of the media player displayedon the mobile phone. After the mobile phone receives the tappingoperation performed by the user on the pause button in the interface ofthe media player, the application processor of the mobile phone maygenerate the pause command in response to the tapping operation on thepause button. The application processor of the mobile phone transmitsthe pause command to the audio profile layer.

The DDM at the audio profile layer may encode the pause command withreference to the A2DP and the AVDTP. The DDM may further add a packetheader to the encoded pause command, to package the encoded pausecommand into a payload (payload) in a “packet header+control data”format.

In this embodiment of this application, the packet header may include afield such as a timestamp (timestamp). The timestamp may be used for areceiving device (such as the left and right earbuds of the TWS headset)to determine a time for executing the control data, that is, determine atime for pausing music playing. The timestamp may be a second timestampin this application. The DDM sends the packaged payload to thecontroller layer by using the L2CAP and the HCI. The controller layermay add fields such as a frame header (frame header), a frame tail(frame tail), and a preamble (preamble) to the payload. For theprocessing of adding a frame header, a frame trailer, and a preamble tothe payload by the controller layer, refer to corresponding descriptionsin the audio data encoding process in this embodiment of thisapplication. Details are not described herein again.

After the foregoing processing is performed, the pause command ispackaged into a packet meeting BLE, for example, referred to as a packet2. For a format of the packet 2, refer to FIG. 8 (the frame trailer andthe preamble are not shown in FIG. 8). The packet 2 may be a secondpacket in this application. The mobile phone may respectively send thepacket 2 to the left and right earbuds of the TWS headset over the ACLlinks. For example, referring to FIG. 6, the mobile phone sends thepacket 2 to the left earbud over the ACL link 1, and sends the packet 2to the right earbud over the ACL link 2.

It should be noted that the foregoing pause command encoding process ismerely an example, and a specific implementation of the process is notlimited in this embodiment of this application. In other words,processing such as encoding and adding a packet header to the controldata such as the pause command transmitted from the applicationprocessor may not be implemented by the corresponding layer in theforegoing example. For example, the processing of encoding the pausecommand with reference to the A2DP and the AVDTP may be implemented bythe controller layer instead of the DDM at the audio profile layer.

After the mobile phone sends the packet 2, the left and right earbuds ofthe TWS headset may separately receive the packet 2 from the mobilephone. The left and right earbuds of the TWS headset may separatelydecode the received packet 2 and perform a corresponding operation, forexample, pause music playing.

In some embodiments, for example, the left earbud of the TWS headsetdecodes the received packet 2. A specific process in which the leftearbud decodes the packet 2 may include the following steps.

After the left earbud of the TWS headset receives the packet 2 over theACL link 1, the controller layer of the left earbud may determine, basedon the frame header in the packet 2, whether the packet 2 is a packetsent to the left earbud. If the packet 2 is a packet sent to the leftearbud, the left earbud may continue to perform subsequent processing onthe packet 2. If the packet 2 is not a packet sent to the left earbud,the left earbud may discard the received packet 2. The controller layerof the left earbud may further determine, based on a correspondingidentifier carried in the frame header of the packet 2, that the packet2 is a control packet. In addition, the packet 2 may be further checkedbased on a check code included in the frame trailer of the packet 2, toensure correctness and integrity of data transmission. After theprocessing is completed, the controller layer of the left earbud maytransmit the payload in the packet 2 to the audio profile layer of theleft earbud by using the HCI and the L2CAP of the left earbud.

The DDM at the audio profile layer may parse the received payload withreference to the A2DP and the AVDTP. The DDM may parse out the packetheader and the encoded pause command in the payload. The DDM maydetermine, based on the timestamp in the packet header, a time forexecuting the pause command. The DDM may further decode the encodedpause command to obtain the pause command.

After the foregoing layer-by-layer processing is performed, the leftearbud of the TWS headset may obtain control data that needs to beexecuted, that is, the pause command. Similarly, the right earbud of theTWS headset may also process the received packet 2 to obtain the pausecommand. In addition, in the foregoing processing process, the left andright earbuds of the TWS headset may further obtain times for executingthe pause command. The left and right earbuds of the TWS headset mayrespond to the obtained pause command based on the obtained times. Thetimes for executing the pause command that are obtained by the left andright earbuds of the TWS headset are the same. In this way,synchronization of point-to-multipoint control data is implementedbetween the mobile phone and the left and right earbuds of the TWSheadset. In other words, for the user, the mobile phone can control theleft and right earbuds of the TWS headset to simultaneously pause musicplaying.

It should be noted that the foregoing example is described by using anexample in which the user triggers a pause of music playing on themobile phone. In some other embodiments, the user may alternativelytrigger a pause of music playing on the TWS headset. For example, theleft earbud of the TWS headset includes a touch sensor, and the user mayperform a double-tap operation at a corresponding position of the touchsensor in the left earbud, to trigger a pause of music playing. Afterthe left earbud of the TWS headset receives the operation, in responseto the operation, the left earbud of the TWS headset may generate apause command and send the pause command to the mobile phone. Afterreceiving the pause command, the mobile phone may perform the foregoingencoding process to obtain a packet 2 and send the packet 2 to the leftand right earbuds of the TWS headset, to implement synchronization ofpauses of the left and right earbuds of the TWS headset in userperception. In addition, an implementation of synchronization of othercontrol data such as a play command is similar to an implementationprocess of synchronization of the pause command in the foregoingexample. Details are not described herein in this embodiment of thisapplication.

For another example, with reference to FIG. 5 and FIG. 6, the TWSheadset is used as an audio input/output device of the mobile phone toimplement a call. During a call, the mobile phone may encode voice datasent by a peer call device and then send the encoded voice data to theleft and right earbuds of the TWS headset.

In some embodiments, referring to FIG. 9, a process in which the mobilephone encodes voice data may specifically include the following steps.

When the mobile phone performs a voice or video call with the peer calldevice, when receiving voice data sent by the peer call device, forexample, referred to as voice data 1, the mobile communications moduleof the mobile phone may transmit the voice data 1 to the audio profilelayer by using a modem and the audio module of the mobile phone.

The DDM at the audio profile layer may encode the voice data 1 withreference to a BLE-based audio profile, that is, the HFP. For example,voice data 2 is obtained after the voice data 1 is encoded. The DDMtransmits the voice data 2 to the DADP. For a specific implementation ofencoding the voice data 1 based on the HFP by the DDM, refer to anexisting implementation of encoding voice data based on the HFP. Detailsare not described herein in this embodiment of this application.

The DADP encodes the received voice data 2. For example, voice data 3 isobtained after the voice data 2 is encoded. The DADP adds a packetheader to the voice data 3, to package the voice data 3 into a payload(payload) in a “packet header+audio data” format. The packet header mayinclude the following fields: an SN, a timestamp (timestamp), and apayload length (payload length). The payload length is a length of thevoice data 3. The SN and the payload length may be used to determinewhether a packet loss occurs in packets. When a packet loss occurs, theSN and the payload length may be further used for corresponding packetloss compensation. The timestamp may be used for a receiving device(such as the left and right earbuds of the TWS headset) to determine atime for playing the voice data. The timestamp may be a first timestampin this application.

The DADP transmits the packaged payload to the controller layer by usingthe HCI. The controller layer may add fields such as a frame header(frame header), a frame tail (frame tail), and a preamble (preamble) tothe payload. For the processing of adding a frame header, a frametrailer, and a preamble to the payload by the controller layer, refer tocorresponding descriptions in the audio data encoding process in thisembodiment of this application. Details are not described herein again.

After the foregoing processing is performed, the voice data received bythe mobile phone from the peer call device, that is, the voice data 1,is packaged into a packet 3 meeting BLE. For a data format of the packet3, refer to FIG. 9 (the frame trailer and the preamble are not shown inFIG. 9). The packet 3 may be a first packet in this application. Themobile phone may respectively send the packet 3 to the left and rightearbuds of the TWS headset through the ISO channels. For example,referring to FIG. 6, the mobile phone sends the packet 3 to the leftearbud through the ISO channel 1, and sends the packet 3 to the rightearbud through the ISO channel 2.

It should be noted that the foregoing voice data encoding process ismerely an example, and a specific implementation of the process is notlimited in this embodiment of this application. In other words,processing such as encoding and adding a packet header to the voice datatransmitted from the audio module may not be implemented by thecorresponding layer in the foregoing example. For example, theprocessing of encoding the voice data with reference to the HFP may beimplemented by the controller layer instead of the DDM at the audioprofile layer. For another example, the processing of adding a packetheader to the voice data may be implemented by the controller layerinstead of the DADP. In some other embodiments, the audio module mayalternatively directly transmit the voice data to the controller layer.The controller layer may not perform processing such as encoding oradding a packet header to the received voice data, but adds fields suchas a frame header and a frame tail, and then respectively sends thevoice data to the left and right earbuds of the TWS headset through theISO channels. The left and right earbuds of the TWS headsets mayseparately play the voice data immediately after receiving the voicedata, to implement rendering synchronization.

After the mobile phone sends the packet 3, the left and right earbuds ofthe TWS headset may separately receive the packet 3 from the mobilephone. The left and right earbuds of the TWS headset may separatelydecode and play the received packet 3.

In some embodiments, for example, the left earbud of the TWS headsetdecodes the received packet 3. A specific process in which the leftearbud decodes the packet 3 may include the following steps.

After the left earbud of the TWS headset receives the packet 3 throughthe ISO channel 1, the controller layer of the left earbud maydetermine, based on the frame header in the packet, whether the packet 3is a packet sent to the left earbud. If the packet 3 is a packet sent tothe left earbud, the left earbud may continue to perform subsequentprocessing on the packet 3. If the packet 3 is not a packet sent to theleft earbud, the left earbud may discard the received packet 3. Thecontroller layer of the left earbud may further determine, based on theframe header of the packet 3, that the packet 3 is a data packet. Inaddition, the packet 3 may be further checked based on the frame trailerin the packet 3, to ensure correctness and integrity of datatransmission. After the processing is completed, the controller layer ofthe left earbud may transmit the payload in the packet 3 to the DADP byusing the HCI of the left earbud.

After receiving the payload, the DADP may parse out the packet headerand the voice data 3 in the payload. The DADP may determine, based onthe SN and the payload length in the packet header, whether a packetloss occurs in packets. If a packet loss occurs, the DADP may furtherperform corresponding packet loss compensation based on the SN and thepayload length. In addition, the DADP may further determine, based onthe timestamp in the packet header, the time for playing the voice data.The DADP may further decode the voice data 3, for example, decode thevoice data 3 to obtain the voice data 2. The DADP transmits the decodedvoice data 2 to the DDM at the audio profile layer of the left earbud.

The DDM decodes the voice data 2 with reference to an audio profileobtained after the negotiation, that is, the HFP, for example, decodesthe voice data 2 to obtain the voice data 1.

After the foregoing processing is performed, the left earbud of the TWSheadset may obtain voice data that needs to be played, for example, thevoice data 1. Similarly, the right earbud of the TWS headset may alsoprocess the received packet 3 to obtain the voice data 1 that needs tobe played. In addition, in the foregoing processing process, the leftand right earbuds of the TWS headset may further obtain times forplaying the voice data. The left and right earbuds of the TWS headsetmay play the respectively obtained voice data based on the obtainedplaying times. The times for playing the voice data that are obtained bythe left and right earbuds of the TWS headset are the same. In this way,point-to-multipoint data transmission can be implemented between themobile phone and the left and right earbuds of the TWS headset, andrendering synchronization of the voice data can also be implementedbetween the left and right earbuds of the TWS headset.

In some other embodiments, when the TWS headset is used as an audioinput/output device of the mobile phone to implement a call, when theuser speaks, an earbud (for example, the left earbud) of the TWS headsetmay collect a sound signal of the user by using a microphone of theearbud. The left earbud may convert the collected sound signal intovoice data, encode the voice data, and transmit the data to the mobilephone. After receiving the data sent by the left earbud of the TWSheadset, the mobile phone may perform decoding processing to obtain thevoice data that needs to be sent to a peer call device. In someembodiments, a specific process in which the left earbud encodes thevoice data may be as follows: After collecting the sound signal andconverting the sound signal into the voice data, the microphone of theleft earbud may transmit the voice data to the audio profile layer ofthe left earbud. The DDM at the audio profile layer may encode the voicedata with reference to the HFP, and then transmit the encoded voice datato the controller layer by using the HCI. The controller layer may addfields such as a frame header, a frame trailer, and a preamble to theencoded voice data, to package the encoded voice data into a packet, andtransmit the packet to the mobile phone through the ISO channel 1. Aspecific process in which the mobile phone decodes the received packetmay be as follows: After the mobile phone receives the packet, thecontroller layer of the mobile phone may perform correspondingprocessing on the packet based on the frame header, the frame trailer,and the preamble of the packet, for example, determine whether thepacket is a packet sent to the mobile phone, and check the packet. Afterthe processing is completed, a payload field in the packet istransmitted to the audio profile layer by using the HCI. The DDM at theaudio profile layer may decode the encoded voice data in the payloadwith reference to the HFP, to obtain the voice data. After obtaining thevoice data, the mobile phone may transmit the voice data to the peercall device.

In some other embodiments, when the TWS headset is used as an audioinput/output device of the mobile phone to implement a call, in additionto the voice data, control data of commands such as answering anincoming call, hanging up a call, rejecting an incoming call, voicedialing, holding a call, and callback may be transmitted between themobile phone and the TWS headset. In this embodiment of thisapplication, based on the audio transmission framework shown in FIG. 5,synchronization of point-to-multipoint control data can also beimplemented between the mobile phone and the left and right earbuds ofthe TWS headset by using an audio profile supporting BLE. In otherwords, for the user, the mobile phone can ensure that the left and rightearbuds of the TWS headset synchronously answer/hang up a call or thelike. For example, with reference to FIG. 5 and FIG. 6, the mobile phonecurrently implements a call by using the TWS headset, and the userperforms an operation of hanging up the call on the mobile phone. Themobile phone may receive the operation of hanging up the call by theuser. For example, the operation of hanging up the call may be a tappingoperation performed by the user on a hang-up button in a call interfacedisplayed on the mobile phone. In response to the operation of hangingup the call, the mobile phone may separately send a hang-up command tothe left and right earbuds of the TWS headset. In addition, the mobilephone may further transmit the hang-up command to a peer call device toend the call. Before sending the hang-up command, the mobile phone mayencode the hang-up command.

In some embodiments, referring to FIG. 10, a process in which the mobilephone encodes the hang-up command may specifically include the followingsteps.

For example, the operation of hanging up the call is a tapping operationperformed by the user on the hang-up button in the call interfacedisplayed on the mobile phone. After the mobile phone receives thetapping operation performed by the user on the hang-up button in thecall interface, the application processor of the mobile phone maygenerate the hang-up command in response to the tapping operation on thehang-up button. The application processor of the mobile phone transmitsthe hang-up command to the audio profile layer.

The DDM at the audio profile layer may encode the hang-up command withreference to the HFP, and transmit the encoded hang-up command to theRFCOMM. The RFCOMM may add a packet header to the encoded hang-upcommand, to package the encoded hang-up command into a payload (payload)in a “packet header+control data” format.

In this embodiment of this application, the packet header may include afield such as a timestamp (timestamp). The timestamp may be used for areceiving device (such as the left and right earbuds of the TWS headset)to determine a time for executing the control data, that is, determine atime for ending the call. The timestamp may be a second timestamp inthis application. The RFCOMM sends the packaged payload to thecontroller layer by using the L2CAP and the HCI. The controller layermay add fields such as a frame header, a frame tail, and a preamble tothe payload. For the processing of adding a frame header, a frametrailer, and a preamble to the payload by the controller layer, refer tocorresponding descriptions in the audio data encoding process in thisembodiment of this application. Details are not described herein again.

After the foregoing processing is performed, the hang-up command ispackaged into a packet meeting BLE, for example, referred to as a packet4. For a format of the packet 4, refer to FIG. 10 (the frame trailer andthe preamble are not shown in FIG. 1). The packet 4 may be a secondpacket in this application. The mobile phone may respectively send thepacket 4 to the left and right earbuds of the TWS headset over the ACLlinks. For example, referring to FIG. 6, the mobile phone sends thepacket 4 to the left earbud over the ACL link 1, and sends the packet 4to the right earbud over the ACL link 2.

It should be noted that the foregoing hang-up command encoding processis merely an example, and a specific implementation of the process isnot limited in this embodiment of this application. In other words,processing such as encoding and adding a packet header to the controldata such as the hang-up command transmitted from the applicationprocessor may not be implemented by the corresponding layer in theforegoing example. For example, the processing of encoding the hang-upcommand with reference to the HFP may not be implemented by the DDM atthe audio profile layer, and the processing of adding a packet headermay not be implemented by the RFCOMM, but both are implemented by thecontroller layer.

After the mobile phone sends the packet 4, the left and right earbuds ofthe TWS headset may separately receive the packet 4 from the mobilephone. The left and right earbuds of the TWS headset may separatelydecode the received packet 4 and perform a corresponding operation, forexample, ending the call, to stop voice data playing and stop voice datacollection.

In some embodiments, for example, the left earbud of the TWS headsetdecodes the received packet 4. A specific process in which the leftearbud decodes the packet 4 may include the following steps.

After the left earbud of the TWS headset receives the packet 4 over theACL link 1, the controller layer of the left earbud may performcorresponding processing on the packet 4 based on the frame header, theframe trailer, and the preamble in the packet 4, for example, determinewhether the packet 4 is a packet sent to the left earbud, and check thepacket 4. After the processing is completed, the controller layer of theleft earbud may transmit the payload in the packet 4 to the audioprofile layer of the left earbud by using the HCI and the L2CAP of theleft earbud.

The RFCOMM at the audio profile layer may parse the received payload.The RFCOMM may parse out the packet header and the encoded hang-upcommand in the payload. The RFCOMM may determine, based on the timestampin the packet header, a time for executing the hang-up command, that is,determine a time for ending the call. The RFCOMM may further transmitthe obtained encoded hang-up command to the DDM. The DDM may decode theencoded hang-up command to obtain the hang-up command.

After the foregoing processing is performed, the left earbud of the TWSheadset may obtain control data that needs to be executed, that is, thehang-up command. Similarly, the right earbud of the TWS headset may alsoprocess the received packet 4 to obtain the hang-up command. Inaddition, in the foregoing processing process, the left and rightearbuds of the TWS headset may further obtain times for executing thehang-up command. The left and right earbuds of the TWS headset mayrespond to the obtained hang-up command based on the obtained times. Thetimes for executing the hang-up command that are obtained by the leftand right earbuds of the TWS headset are the same. In this way,synchronization of point-to-multipoint control data is implementedbetween the mobile phone and the left and right earbuds of the TWSheadset. In other words, for the user, the mobile phone can control theleft and right earbuds of the TWS headset to simultaneously end thecall, to stop voice data playing and stop voice data collection.

It should be noted that the foregoing example is described by using anexample in which the user triggers, on the mobile phone, the currentcall to be ended. In some other embodiments, the user may alternativelytrigger, on the TWS headset, the current call to be ended. For example,the right earbud of the TWS headset includes a touch sensor, and theuser may perform a tapping operation at a corresponding position of thetouch sensor in the right earbud, to trigger the mobile phone to end thecurrent call. After the right earbud of the TWS headset receives theoperation, in response to the operation, the right earbud of the TWSheadset may generate a hang-up command and send the hang-up command tothe mobile phone. After receiving the hang-up command, the mobile phonemay perform the foregoing encoding process to obtain a packet 4 and sendthe packet 4 to the left and right earbuds of the TWS headset, toimplement synchronization of ending the call by the left and rightearbuds of the TWS headset in user perception. In addition, animplementation of synchronization of other control data such asanswering a call or rejecting an incoming call is similar to animplementation process of synchronization of hanging up a call in theforegoing example. For example, when receiving an incoming call, themobile phone may send an answering command to the left and right earbudsof the TWS headset, so that the left and right earbuds of the TWSheadset can simultaneously play a ringtone of the mobile phone or alocal ringtone of the earbuds. For another example, after the userperforms dialing, the mobile phone may send a dialing command to theleft and right earbuds of the TWS headset, so that the left and rightearbuds of the TWS headset can simultaneously play a ringback tone.Details are not described in this embodiment of this application.

In some other embodiments, when the TWS headset is used as an audiooutput device of the mobile phone to play music, or is used as an audioinput/output device of the mobile phone to implement a call, in additionto the audio data, control data of commands such as volume up and volumedown may be transmitted between the mobile phone and the TWS headset. Inthis embodiment of this application, based on the audio transmissionframework shown in FIG. 5, synchronization of point-to-multipointcontrol data can also be implemented between the mobile phone and theleft and right earbuds of the TWS headset by using an audio profilesupporting BLE. In other words, for the user, the mobile phone canensure that the left and right earbuds of the TWS headset synchronouslyturn up/down the volume. For example, with reference to FIG. 5 and FIG.6, the mobile phone currently plays music by using the TWS headset, andthe user turns up the volume on the mobile phone. The mobile phone mayreceive a volume-up operation of the user. For example, the volume-upoperation may be an operation performed by the user on a volumeadjustment button in the interface of the media player displayed on themobile phone. In response to the volume-up operation, the mobile phonemay separately send a volume-up command to the left and right earbuds ofthe TWS headset. Before sending the volume-up command, the mobile phonemay encode the volume-up command.

In some embodiments, referring to FIG. 11, a process in which the mobilephone encodes the volume-up command may specifically include thefollowing steps.

For example, the volume-up operation is an operation performed by theuser on the volume adjustment button in the interface of the mediaplayer displayed on the mobile phone. After the mobile phone receivesthe tapping operation performed by the user on the volume adjustmentbutton in the interface of the media player, the application processorof the mobile phone may generate the volume-up command in response tothe operation. The application processor of the mobile phone transmitsthe volume-up command to the audio profile layer.

The DDM at the audio profile layer may encode the volume-up command withreference to the AVRCP and the AVDTP. The DDM may further add a packetheader to the encoded volume-up command, to package the encodedvolume-up command into a payload (payload) in a “packet header+controldata” format.

In this embodiment of this application, the packet header may include afield such as a timestamp (timestamp). The timestamp may be used for areceiving device (such as the left and right earbuds of the TWS headset)to determine a time for executing the control data, that is, determine atime for turning up the volume. The timestamp may be a second timestampin this application. The DDM sends the packaged payload to thecontroller layer by using the L2CAP and the HCI. The controller layermay add fields such as a frame header, a frame tail, and a preamble tothe payload. For the processing of adding a frame header, a frametrailer, and a preamble to the payload by the controller layer, refer tocorresponding descriptions in the audio data encoding process in thisembodiment of this application. Details are not described herein again.

After the foregoing processing is performed, the volume-up command ispackaged into a packet meeting BLE, for example, referred to as a packet5. For a format of the packet 5, refer to FIG. 11 (the frame trailer andthe preamble are not shown in FIG. 11). The packet 5 may be a secondpacket in this application. The mobile phone may respectively send thepacket 5 to the left and right earbuds of the TWS headset over the ACLlinks. For example, referring to FIG. 6, the mobile phone sends thepacket 5 to the left earbud over the ACL link 1, and sends the packet 5to the right earbud over the ACL link 2.

It should be noted that the foregoing volume-up command encoding processis merely an example, and a specific implementation of the process isnot limited in this embodiment of this application. In other words,processing such as encoding and adding a packet header to the controldata such as the volume-up command transmitted from the applicationprocessor may not be implemented by the corresponding layer in theforegoing example. For example, the processing of encoding the volume-upcommand with reference to the AVRCP and the AVDTP may be implemented bythe controller layer instead of the DDM at the audio profile layer.

After the mobile phone sends the packet 5, the left and right earbuds ofthe TWS headset may separately receive the packet 5 from the mobilephone. The left and right earbuds of the TWS headset may separatelydecode the received packet 5 and perform a corresponding operation, forexample, turn up the volume.

In some embodiments, for example, the left earbud of the TWS headsetdecodes the received packet 5. A specific process in which the leftearbud decodes the packet 5 may include the following steps.

After the left earbud of the TWS headset receives the packet 5 over theACL link 1, the controller layer of the left earbud may performcorresponding processing on the packet 5 based on the frame header, theframe trailer, and the preamble in the packet 5, for example, determinewhether the packet 5 is a packet sent to the left earbud, and check thepacket 5. After the processing is completed, the controller layer of theleft earbud may transmit the payload in the packet 5 to the audioprofile layer of the left earbud by using the HCI and the L2CAP of theleft earbud.

The DDM at the audio profile layer may parse the received payload withreference to the AVRCP and the AVDTP. The DDM may parse out the packetheader and the encoded volume-up command in the payload. The DDM maydetermine, based on the timestamp in the packet header, a time forexecuting the volume-up command. The DDM may further decode the encodedvolume-up command to obtain the volume-up command.

After the foregoing processing is performed, the left earbud of the TWSheadset may obtain control data that needs to be executed, that is, thevolume-up command. Similarly, the right earbud of the TWS headset mayalso process the received packet 5 to obtain the volume-up command. Inaddition, in the foregoing processing process, the left and rightearbuds of the TWS headset may further obtain times for executing thevolume-up command. The left and right earbuds of the TWS headset mayturn up the volume based on the obtained times. The times for executingthe volume-up command that are obtained by the left and right earbuds ofthe TWS headset are the same. In this way, synchronization ofpoint-to-multipoint control data is implemented between the mobile phoneand the left and right earbuds of the TWS headset. In other words, forthe user, the mobile phone can control the left and right earbuds of theTWS headset to simultaneously turn up the volume.

It should be noted that the foregoing example is described by using anexample in which the user adjusts the volume on the mobile phone. Insome other embodiments, the user may alternatively adjust the volume onthe TWS headset. For example, the left earbud of the TWS headsetincludes a touch sensor, and the user may perform a sliding operation ata corresponding position of the touch sensor in the left earbud, toadjust the volume. After the left earbud of the TWS headset receives theoperation, in response to the operation, the left earbud of the TWSheadset may generate a volume-up command and send the volume-up commandto the mobile phone. After receiving the volume-up command, the mobilephone may perform the foregoing encoding process to obtain a packet 5and send the packet 5 to the left and right earbuds of the TWS headset,to implement synchronization of volume up of the left and right earbudsof the TWS headset in user perception. In addition, an implementation ofsynchronization of other control data such as volume down is similar toan implementation process of volume up in the foregoing example. Detailsare not described herein in this embodiment of this application.

Some other embodiments of this application further provide a peripheraldevice. For example, the peripheral device is a TWS headset. As shown inFIG. 12, an earbud of the TWS headset may include: one or moreprocessors 1201, a memory 1202, a communications interface 1203, areceiver 1204, a microphone 1205, and one or more computer programs1206. The components may be connected by using one or morecommunications buses 1207. The one or more computer programs 1206 arestored in the memory 1202, and are configured to be executed by the oneor more processors 1201. The one or more computer programs 1206 includeinstructions, and the instructions may be used to perform stepsperformed by an earbud (for example, a left earbud and a right earbud)of a TWS headset in the embodiments corresponding to FIG. 6 to FIG. 11.Certainly, the earbud of the TWS headset shown in FIG. 12 may furtherinclude another component such as a sensor. This is not limited in thisembodiment of this application.

Some other embodiments of this application further provide an electronicdevice. As shown in FIG. 13, the electronic device may include: atouchscreen 1301, where the touchscreen 1301 may include atouch-sensitive surface 1306 and a display 1307; one or more processors1302; a memory 1303; and one or more computer programs 1304. Thecomponents may be connected by using one or more communications buses1305. The one or more computer programs 1304 are stored in the memory1303, and are configured to be executed by the one or more processors1302. The one or more computer programs 1304 include instructions, andthe instructions may be used to perform steps performed by an electronicdevice in the embodiments corresponding to FIG. 6 to FIG. 11. Certainly,the electronic device shown in FIG. 13 may further include anothercomponent such as a sensor module, an audio module, and a SIM cardinterface. This is not limited in this embodiment of this application.

The foregoing descriptions about implementations allow a person skilledin the art to understand that, for the purpose of convenient and briefdescription, division of the foregoing function modules is taken as anexample for illustration. In actual application, the foregoing functionscan be allocated to different modules and implemented according to arequirement, that is, an inner structure of an apparatus is divided intodifferent function modules to implement all or some of the functionsdescribed above. For a detailed working process of the foregoing system,apparatus, and unit, refer to a corresponding process in the foregoingmethod embodiments, and details are not described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, the module or unitdivision is merely logical function division and may be other divisionin actual implementation. For example, a plurality of units orcomponents may be combined or integrated into another system, or somefeatures may be ignored or not performed. In addition, the displayed ordiscussed mutual couplings or direct couplings or communicationconnections may be implemented by using some interfaces. The indirectcouplings or communication connections between the apparatuses or unitsmay be implemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software functional unit.

When the integrated unit is implemented in the form of a softwarefunctional unit and sold or used as an independent product, theintegrated unit may be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions in theembodiments of the present invention essentially, or the partcontributing to the prior art, or all or some of the technical solutionsmay be implemented in the form of a software product. The softwareproduct is stored in a storage medium and includes several instructionsfor instructing a computer device (which may be a personal computer, aserver, or a network device) to perform all or some of the steps of themethods described in the embodiments of the present invention. Theforegoing storage medium includes: any medium that can store programcode, such as a flash memory, a removable hard disk, a read-only memory,a random access memory, a magnetic disk, or an optical disc.

The foregoing descriptions are merely specific implementations of theembodiments, but are not intended to limit the protection scope of theembodiments. Any variation or replacement within the technical scopedisclosed in the embodiments shall fall within the protection scope ofthe embodiments. Therefore, the protection scope of the embodimentsshall be subject to the protection scope of the claims.

1. A point-to-multipoint data transmission method comprising: separatelypairing up, by a first earbud of a true wireless stereo (TWS) headsetand a second earbud of the TWS headset, with an electronic device;obtaining a service type supported by the electronic device byseparately performing, by the first earbud and the second earbud,service content negotiation with the electronic device, wherein theservice type supported by the electronic device comprises a Bluetoothlow energy (BLE)-based audio profile, and wherein service typessupported by the first earbud and the second earbud comprise theBLE-based audio profile; receiving, by the first earbud, firstconfiguration information sent by the electronic device, wherein thefirst configuration information is associated with configuration of afirst isochronous ISO channel between the first earbud and theelectronic device; receiving, by the second earbud, second configurationinformation sent by the electronic device, wherein the secondconfiguration information is is associated with configuration of asecond ISO channel between the second earbud and the electronic device;receiving, by the first earbud based on the BLE-based audio profile,audio data that is sent by the electronic device through the first ISOchannel; receiving, by the second earbud based on the BLE-based audioprofile, the audio data that is sent by the electronic device throughthe second ISO channel; and playing, by the first earbud and the secondearbud, the respectively received audio data based on a first timestamp.2. The method according to claim 1, further comprising: setting up, bythe first earbud, a first asynchronous connection-oriented link (ACL) tothe electronic device; and setting up, by the second earbud, a secondACL link to the electronic device; wherein the receiving, the firstconfiguration information sent by the electronic device comprisesreceiving, by the first earbud, the first configuration information thatis sent by the electronic device over the first ACL link; and whereinthe receiving, by the second earbud, second configuration informationsent by the electronic device comprises receiving, by the second earbud,the second configuration information that is sent by the electronicdevice over the second ACL link.
 3. The method according to claim 2,further comprising receiving, by the first earbud based on the BLE-basedaudio profile, control data that is sent by the electronic device overthe first ACL link; receiving, by the second earbud based on theBLE-based audio profile, the control data that is sent by the electronicdevice over the second ACL link; and responding, by the first earbud andthe second earbud, to the respectively received control data based on asecond time stamp.
 4. The method according to claim 1, wherein thereceiving, by the first earbud based on the BLE-based audio profile, theaudio data that is sent by the electronic device through the first ISOchannel comprises: receiving, by the first earbud based on the BLE-basedaudio profile, a first packet that is sent by the electronic devicethrough the first ISO channel, wherein the first packet comprises afirst payload, and the first payload comprises the audio data and thefirst timestamp; and wherein the receiving, by the second earbud basedon the BLE-based audio profile, the audio data that is sent by theelectronic device through the second ISO channel comprises: receiving,by the second earbud based on the BLE-based audio profile, the firstpacket that is sent by the electronic device through the second ISOchannel.
 5. The method according to claim 3, wherein the receiving thecontrol data that is sent by the electronic device over the first ACLlink comprises: receiving, by the first earbud based on the BLE-basedaudio profile, a second packet that is sent by the electronic deviceover the first ACL link, wherein the second packet comprises a secondpayload, and wherein the second payload comprises the control data andthe second time stamp; and wherein the receiving, by the second earbudbased on the BLE-based audio profile, the control data that is sent bythe electronic device over the second ACL link comprises: receiving, bythe second earbud based on the BLE-based audio profile, the secondpacket that is sent by the electronic device over the second ACL link.6. A point-to-multipoint data transmission method, comprising:separately pairing up, by an electronic device, with a first earbud anda second earbud of a TWS headset; obtaining, by the electronic device,service types supported by the first earbud and the second earbud byseparately performing, by the electronic device, service contentnegotiation with the first earbud and the second earbud, to, wherein theservice types supported by the first earbud and the second earbudcomprise a Bluetooth low energy BLE-based audio profile, and a servicetype supported by the electronic device comprises the BLE-based audioprofile; sending, by the electronic device, first configurationinformation to the first earbud, wherein the first configurationinformation is is associated with configuration of a first isochronousISO channel between the electronic device and the first earbud; sending,by the electronic device, second configuration information to the secondearbud, wherein the second configuration information is is associatedwith configuration of a second ISO channel between the electronic deviceand the second earbud; and sending, by the electronic device based onthe BLE-based audio profile, audio data to the first earbud through thefirst ISO channel, and sending the audio data to the second earbudthrough the second ISO channel.
 7. The method according to claim 6,further comprising: setting up, by the electronic device, a firstasynchronous connection-oriented link (ACL) to the first earbud; andsetting up, by the electronic device, a second ACL link to the secondearbud; wherein the sending, by the electronic device, firstconfiguration information to the first earbud comprises sending, by theelectronic device, the first configuration information to the firstearbud over the first ACL link; and wherein the sending, by theelectronic device, second configuration information to the second earbudcomprises sending, by the electronic device, the second configurationinformation to the second earbud over the second ACL link.
 8. The methodaccording to claim 7, further comprising: sending, by the electronicdevice based on the BLE-based audio profile, control data to the firstearbud over the first ACL link; and sending the control data to thesecond earbud over the second ACL link.
 9. The method according to claim6, wherein the sending, by the electronic device based on the BLE-basedaudio profile, the audio data to the first earbud through the first ISOchannel, and sending the audio data to the second earbud through thesecond ISO channel comprises: generating, by the electronic device, afirst packet by encoding the audio data based on the BLE-based audioprofile, wherein the first packet comprises a first payload, wherein thefirst payload comprises the audio data and a first timestamp, andwherein the first timestamp is used for the first earbud and the secondearbud to implement rendering synchronization of the audio data;sending, by the electronic device, the first packet to the first earbudthrough the first ISO channel; and sending, by the electronic device,the first packet to the second earbud through the second ISO channel.10. The method according to claim 8, wherein the sending, by theelectronic device based on the BLE-based audio profile, control data tothe first earbud over the first ACL link, and the sending the controldata to the second earbud over the second ACL link comprises: generatinga second packet by encoding, by the electronic device, the control databased on the BLE-based audio profile, wherein the second packetcomprises a second payload, wherein the second payload comprises thecontrol data and a second time stamp, and wherein the second time stampis associated with the first earbud and the second earbud implementingsynchronization of the control data; sending, by the electronic device,the second packet to the first earbud over the first ACL link; andsending, by the electronic device, the second packet to the secondearbud over the second ACL link.
 11. A true wireless stereo TWS headset,comprising: a first earbud; and a second earbud; wherein the firstearbud and the second earbud each comprise; a processor; anon-transitory memory; a wireless communications module; a receiver; anda microphone; wherein the memory, the wireless communications module,the receiver, and the microphone are coupled to the processor; whereinthe non-transitory memory is stores computer program code for executionby the processor; wherein the computer program code of the first earbudincludes computer instructions for: pairing up with an electronicdevice; obtaining a service type supported by the electronic device byperforming service content negotiation with the electronic device,wherein the service type supported by the electronic device comprises aBluetooth low energy (BLE)-based audio profile, and wherein a servicetype supported by the first earbud comprises the BLE-based audioprofile; receiving first configuration information sent by theelectronic device, wherein the first configuration information isassociated with a first isochronous (ISO) channel between the firstearbud and the electronic device; receiving audio data that is sent bythe electronic device through the first ISO channel based on theBLE-based audio profile; and playing the received audio data based on afirst timestamp; and wherein the computer program code of the secondearbud includes computer instructions for: pairing up with theelectronic device; obtaining the service type supported by theelectronic device by performing service content negotiation with theelectronic device, wherein the service type supported by the electronicdevice comprises a BLE-based audio profile, and wherein a service typesupported by the second earbud comprises the BLE-based audio profile;receiving second configuration information sent by the electronicdevice, wherein the second configuration information is used toconfigure a second isochronous (ISO) channel between the second earbudand the electronic device; receiving audio data that is sent by theelectronic device through the second ISO channel based on the BLE-basedaudio profile; and playing the received audio data based on the firsttimestamp. 12-17. (canceled)
 18. The TWS headset according to claim 11,wherein the computer program code of the first earbud further includescomputer instructions for: setting up a first asynchronousconnection-oriented link (ACL) to the electronic device; wherein thecomputer instructions that are of the computer program code of the firstearbud and that are for the receiving the first configurationinformation sent by the electronic device include computer instructionsfor: receiving the first configuration information that is sent by theelectronic device over the first ACL link; and wherein the computerprogram code of the second earbud further includes computer instructionsfor: setting up a second ACL link to the electronic device; and whereinthe computer instructions that are of the computer program code of thefirst earbud and that are for the receiving the second configurationinformation sent by the electronic device include computer instructionsfor: receiving the second configuration information that is sent by theelectronic device over the second ACL link.
 19. The TWS headsetaccording to claim 18, wherein the computer program code of the firstearbud further includes computer instructions for: receiving controldata that is sent by the electronic device over the first ACL link basedon the BLE-based audio profile; and responding to the received controldata based on a second time stamp; and wherein the computer program codeof the second earbud further includes computer instructions for:receiving control data that is sent by the electronic device over thesecond ACL link based on the BLE-based audio profile; and responding tothe received control data based on the second time stamp.
 20. The TWSheadset according to claim 11, wherein the computer instructions thatare of the computer program code of the first earbud and that are forthe receiving the audio data that is sent by the electronic devicethrough the first ISO channel based on the BLE-based audio profileinclude computer instructions for: receiving a first packet that is sentby the electronic device through the first ISO channel based on theBLE-based audio profile, wherein the first packet comprises a firstpayload, and the first payload comprises the audio data and the firsttimestamp; and wherein the computer instructions that are of thecomputer program code of the first earbud and that are for the receivingthe audio data that is sent by the electronic device through the secondISO channel based on the BLE-based audio profile include computerinstructions for: receiving the first packet that is sent by theelectronic device through the second ISO channel based on the BLE-basedaudio profile.
 21. The TWS headset according to claim 19, wherein thecomputer instructions that are of the computer program code of the firstearbud and that are for the receiving the control data that is sent bythe electronic device over the first ACL link based on the BLE-basedaudio profile include computer instructions for: receiving a secondpacket that is sent by the electronic device over the first ACL linkbased on the BLE-based audio profile, wherein the second packetcomprises a second payload, and the second payload comprises the controldata and the second time stamp; and wherein the computer instructionsthat are of the computer program code of the first earbud and that arefor the receiving the control data that is sent by the electronic deviceover the second ACL link based on the BLE-based audio profile includecomputer instructions for: receiving the second packet that is sent bythe electronic device over the second ACL link based on the BLE-basedaudio profile.